version 3
Insert string (source; what; where) 文字列
| 引数 | 型 | 説明 | |
| source | 文字列 | 文字列を挿入する文字列 | |
| what | 文字列 | 挿入する文字列 | |
| where | 数値 | 挿入する位置 |
戻り値 文字列 結果の文字列
説明
Insert stringは、sourceに文字列を挿入したものを返します。Insert stringは、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.