The `length` property in Dart returns the number of elements in the sequence of Unicode code points.
The syntax of Runes.length property is:
int length
This length property of Runes returns the number of elements in this
.
Runes.length returns value of type int
.
In this example,
runes
from the string 'Hello'.length
property to get its length.void main() {
Runes runes = Runes('Hello');
int length = runes.length;
print('Length of sequence: $length');
}
Length of sequence: 5
In this example,
emojis
from the string '🚀🌟'.length
property to get its length.void main() {
Runes emojis = Runes('🚀🌟');
int emojiLength = emojis.length;
print('Length of emoji sequence: $emojiLength');
}
Length of emoji sequence: 2
In this Dart tutorial, we learned about length property of Runes: the syntax and few working examples with output and detailed explanation for each example.