The `toString` method in Dart returns a string representation of some or all of the elements of the Rune sequence.
The syntax of Runes.toString() method is:
String toString()
This toString() method of Runes returns a string representation of (some of) the elements of this
.
Runes.toString() returns value of type String
.
In this example,
runes
from the string 'Hello'.toString
method to get the string representation of the runes.void main() {
Runes runes = Runes('Hello');
String runesString = runes.toString();
print('String representation of runes: $runesString');
}
String representation of runes: (72, 101, 108, 108, 111)
In this example,
numbers
from the string '12345'.toString
method to get the string representation of the numbers.void main() {
Runes numbers = Runes('12345');
String numbersString = numbers.toString();
print('String representation of numbers: $numbersString');
}
String representation of numbers: (49, 50, 51, 52, 53)
In this Dart tutorial, we learned about toString() method of Runes: the syntax and few working examples with output and detailed explanation for each example.