Dart Programming - toString Method



Returns a string representation of an object.

Syntax

val.toString()

Return Type

Returns a string.

Example

void main() { 
   int n = 12; 
   var res = n.toString(); 
   print("New String: ${res}");
}   

It will produce the following output −.

New String: 12
dart_programming_string.htm
Advertisements