 文字列置換

＜概要＞
　文字列中の指定された文字列を置換します。返り値は置き換え後の文字列です。

＜前提条件・制限＞
　特になし。

＜インストール＞

    ソースをパスの通ったディレクトリにデータファイルとしてコピーします。 

＜パラメータ＞
　括弧の中にカンマ（","）で区切って指定します。最初のパラメータの文字列中で、２番目のパラメータに一致する文字列を３番目の文字列で置き換えます。

    全体の文字列。
    置換される文字列。
    置換する文字列。 

＜実行＞
　関数ですのでREXXプログラムから使用する必要があります。あるいはOS/2コマンドプロンプトから なら、rexxtryコマンドでテストできます。
　下記の例では、文字列"abc%sdef"中の"%s"を"xyz"で置き換えています。

例：
[F:\]rexxtry say replstr("abc%sdef", "%s", "xyz")
abcxyzdef
  ................................................ REXXTRY.CMD on OS/2

[F:\]


ENGLISH TRANSLATION WITH GOOGLE
---------------------------------
string replacement

<Overview>
　Replaces the specified string in the string. The return value is the string after replacement.

<Prerequisites and Restrictions>
 nothing special.

<Installation>

    Copy the source to a directory in your path as a data file.

<Parameter>
　Specify by delimiting with commas (",") in parentheses. Replaces strings in the first parameter string that match the second parameter with the third string.

    whole string.
    String to be replaced.
    String to replace.

<Execute>
Since it is a function, it must be used from the REXX program. Or from an OS/2 command prompt you can test with the rexxtry command.
In the example below, "%s" in the string "abc%sdef" is replaced with "xyz".

example:
[F:\]rexxtry say replstr("abc%sdef", "%s", "xyz")
abcxyzdef
  ................................................ REXXTRY. CMD on OS/2

[F:\]

LINK
https://web.archive.org/web/20041121012812/http://www2u.biglobe.ne.jp/~gwm01021/rexx8-1.htm