替换所有匹配的字符串内容。
replaceAll - 语法
String replaceAll(Pattern from, String replace)
from - 要替换的字符串。
replace - 替换字符串。
replaceAll - 返回类型
返回一个字符串。
replaceAll - 示例
void main() { String str1="Hello Learnfk"; print("New String: ${str1.replaceAll(Learnfk,ALL)}"); }
它将产生以下输出-。
New String: Hello ALL