input only numbers flutter
keyboardType: TextInputType.number
i want number before % symbol in flutter
void main() {
String str = "one.two";
print(str.replaceAll(".two", ""));
// or
print(str.split(".").first);
// or
String newStr = str.replaceRange(str.indexOf("."), str.length, "");
print(newStr);
// Lets do a another example
String nums = "1,one.2,two.3,three.4,four";
List values = nums.split("."); // split() will split from . and gives new List with separated elements.
values.forEach(print);
//output
// 1,one
// 2,two
// 3,three
// 4,four
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us