dart

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
Was this helpful?