Insert string
Insert string ( source ; what ; where ) : Text
| 引数 | 型 | 説明 | |
|---|---|---|---|
| source | Text | → | 文字列を挿入する文字列 | 
| what | Text | → | 挿入する文字列 | 
| where | Integer | → | 挿入する位置 | 
| 戻り値 | Text | ← | 結果の文字列 | 
説明
Insert stringは、sourceのwhereで指定された位置の前に、whatを 挿入した文字列を返します。
whatが空の文字列("") であれば、Insert stringはsourceを変更しないで返します。
whereが、sourceの長さよりも大きい場合は、whatをsourceの後ろに追加します。whereが1よりも小さい場合には、whatをsourceの前に挿入します。
Insert stringは、文字を上書きしないで挿入するという点がChange stringと異なります。
例題
Insert string関数の使用例を次に示します。結果を変数vtResultに代入します。
 vtResult:=Insert string("The tree";" green";4) // vtResultは"The green tree"
 vtResult:=Insert string("Shut";"o";3) // vtResultは"Shout"
 vtResult:=Insert string("Indention";"ta";6) // vtResultは"Indentation"
参照
Change string
Delete string
Replace string
プロパティ
| コマンド番号 | 231 | 
| スレッドセーフである | ✓ |