String.Replace 方法(System) | 取代字串
傳回新字串,其中這個執行個體中所有出現的指定Unicode字元都取代成其他指定的Unicode字元。ReturnsanewstringinwhichalloccurrencesofaspecifiedUnicodecharacterinthisinstancearereplacedwithanotherspecifiedUnicodecharacter.public:System::StringReplace(charoldChar,charnewChar);publicstringReplace(charoldChar,charnewChar);memberthis.Replace:char*char->stringPublicFunctionReplace(oldCharAsChar,newCharAsChar)AsString參數oldCharChar[1]要被取代的Unicode字元。TheUnicodecharactertobereplaced.newCharChar[2...
傳回新字串,其中這個執行個體中所有出現的指定 Unicode 字元都取代成其他指定的 Unicode 字元。Returns a new string in which all occurrences of a specified Unicode character in this instance are replaced with another specified Unicode character.
public: System::String Replace(char oldChar, char newChar); public string Replace (char oldChar, char newChar); member this.Replace : char * char -> string Public Function Replace (oldChar As Char, newChar As Char) As String 參數 oldChar Char[1]要被取代的 Unicode 字元。The Unicode character to be replaced.
newChar Char[2]要用來取代所有出現之 oldChar 的 Unicode 字元。The Unicode character to replace all occurrences of oldChar.
傳回 String[3]相當於這個執行個體的字串,只是 oldChar 的所有執行個體都會取代成 newChar。A string that is equivalent to this instance except that all instances of oldChar are replaced with newChar. 如果在目前的執行個體中找不到 oldChar,則方法傳回未變更的目前執行個體。If oldChar is not found in the current insta...