Convert String to Integer in Dart
In this Dart language tutorial we learn how to convert a String value into an integer value in a Dart program.
How to convert String to int in Dart
To parse a String value into an integer we can use int.parse() function as below.
int number = int.parse('123');
The following Dart example program for your more understanding how to use the int.parse() function in Dart program.
void main() {
String stringValue = '223344';
int intValue = int.parse(stringValue);
print('String value: ${stringValue}');
print('Integer value: ${intValue}');
}
String value: 223344
Integer value: 223344
Happy Coding 😊
Related Articles
Convert String to Double in Dart
Convert Integer to String in Dart