首页 > 解决方案 > How to remove a character from string and concatinate it in Dart | Flutter

问题描述

I have two variables

String firstInput = "1.1.5";
String secondInput = "1.1.6";

From this I want the output firstOutput = 115 secondOutput = 116 How to remove dots from the string and concatenate remains as one variable ?

标签: dart

解决方案


You can use the replaceAll method.
It would look like String out = firstInput.replaceAll(".","");


推荐阅读