Chrome Extension

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);
}
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
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