Answers for "dart list cast string to int"

1

dart to int

void main() { 
   double n1 = 2.0; 
   var value = n1.toInt(); 
   print("Output = ${value}"); 
}
Posted by: Guest on November-13-2021
-1

dart string to int

main () {
// String -> int
    var one = int.parse('1');
    print(one == 1); // prints true
    
// String -> double
    var two = double.parse('10');
    print(two); //result is => 10.0
}
Posted by: Guest on February-21-2021

Code answers related to "Dart"

Browse Popular Code Answers by Language