また、Replaceメソッドでは文字(Char)単位での置換も行えます。
String.Replaceメソッドを使って文字列内の一部の文字(Char)を別の文字に置き換える
Imports System
Class Sample
Shared Sub Main()
Dim s As String = "The quick brown fox jumps over the lazy dog"
Console.WriteLine(s);
Console.WriteLine(s.Replace("o"c, "a"c)) ' oをaに置換
End Sub
End Class
実行結果
The quick brown fox jumps over the lazy dog The quick brawn fax jumps aver the lazy dag