C# 字串取代(String.Replace 方法)
C# 字串取代(String.Replace 方法)
資料來源: https://msdn.microsoft.com/zh-tw/library/fk49wtc1(v=vs.110).aspx
using System;
publicclass Example {
publicstaticvoid Main() {
String s = "aaa";//原始字串 Console.WriteLine("The initial string: '{0}'", s); s = s.Replace("a", "b").Replace("b", "c").Replace("c", "d"); Console.WriteLine("The final string: '{0}'", s); }
}
|
One thought on “C# 字串取代(String.Replace 方法)”
C#
字串
替換
取代