charReplace()

概要

str の findChars のすべての文字が、repChars の対応する文字型と置き換わった新しい文字列を返します。

構文

charReplace ( str As String, _
               findChars As String, _
               repChars As String ) As String 
引数 [タイプ] 説明
str 文字列 修正する入力文字列で、空にすることもできます
findChars 文字列 置き換え対象文字の文字列です
repChars 文字列 置き換え用の文字の文字列で、findChars の文字に対応します。findChars と同じ文字数が含まれている必要があります。

例 1

Intent >charReplace("asdf", "a", "b") 
--> "bsdf" 

例 2

Intent >charReplace("asdf", "as", "bx") 
--> "bxdf" 

例 3

Intent >charReplace("asdf", "ks", "bx") 
--> "axdf"