如何从字符串中删除字符并在Dart | FLATTER中对其进行压缩
我有两个变量如何从字符串中删除字符并在Dart | FLATTER中对其进行压缩,dart,Dart,我有两个变量 String firstInput = "1.1.5"; String secondInput = "1.1.6"; 从这里我想要输出firstOutput=115secondOutput=116 如何从字符串中删除点并将其作为一个变量连接?您可以使用该方法。 它看起来像String out=firstInput.replaceAll(“.”,”)您可以使用该方法。 它看起来像String out=firstInput.replaceAl
String firstInput = "1.1.5";
String secondInput = "1.1.6";
从这里我想要输出firstOutput=115
secondOutput=116
如何从字符串中删除点并将其作为一个变量连接?您可以使用该方法。它看起来像
String out=firstInput.replaceAll(“.”,”)代码>您可以使用该方法。
它看起来像String out=firstInput.replaceAll(“.”,”)
您也可以与RE
一起使用,如下所示
void main(){
final myString = '1.3.4.6.6';
String withoutDots = myString.replaceAll(RegExp('\\.'), ''); "Here \\ is used to as esc char"
print(withoutDots); // prints 13466
}
您还可以与RE
一起使用,如下所示
void main(){
final myString = '1.3.4.6.6';
String withoutDots = myString.replaceAll(RegExp('\\.'), ''); "Here \\ is used to as esc char"
print(withoutDots); // prints 13466
}