replace()
描述
String 物件的 replace() 函式可以用另一个字元替代原字串中的字元。另外,你也可以用另一个字串来替代原字串中的字串。
语法
string.replace(substring1, substring2)
参数
string : String 物件 (字串)
substring1 : 另一个 String 物件 (字串)
substring2 : 另一个 String 物件 (字串)
回传
替换后的字串
范例
See also
- String
The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
