メインコンテンツまでスキップ
バージョン: 開発中

Change string

Change string ( source ; newChars ; where ) -> 戻り値

引数説明
source文字🡒元の文字列
newChars文字🡒新しい文字
where倍長整数🡒入れ替え開始位置
戻り値文字🡐結果の文字列

説明

Change stringは、sourceの中の文字グループを修正したものを返します。whereで指定された位置から、newCharssourceを上書きします。

newCharsが空の文字列("")の場合、Change stringはsourceを変更しないで返します。Change stringは常にsourceと同じ長さの文字列を返します。wheresourceの長さ以下の場合やsourceの長さ以上の場合、Change stringはsourceを返します。

Change stringは、文字を挿入しないで上書きするという点がInsert stringと異なります。

例題

Change stringの使用例を次に示します。結果を変数vtResultに代入します。

 vtResult:=Change string("Acme";"CME";2) // vtResultは"ACME"
 vtResult:=Change string("November";"Dec";1) // vtResultは"December"

参照

Delete string
Insert string
Replace string