Search code snippets, questions, articles...

Convert string to integer Dart Program

We can use int.parse() method in dart programming language to convert a string to the integer type.
void main() {
  String numStr = "10";
  
  int num = int.parse(numStr);
  print(num + 10);
}
Output
20

Search Index Data (The code snippet can also be found with below search text)

str to int flutter
str to int dart
Was this helpful?
0 Comments