The `isEmpty` property in Dart checks if there are no elements in the sequence of Unicode code points.
The syntax of Runes.isEmpty property is:
bool isEmpty
This isEmpty property of Runes returns true
if there are no elements in this collection.
Runes.isEmpty returns value of type bool
.
In this example,
emptyRunes
.isEmpty
property to check if it is empty.void main() {
Runes emptyRunes = Runes('');
bool isEmpty = emptyRunes.isEmpty;
print('Is sequence empty? $isEmpty');
}
Is sequence empty? true
In this example,
nonEmptyRunes
from the string 'Hello'.isEmpty
property to check if it is empty.void main() {
Runes nonEmptyRunes = Runes('Hello');
bool isNotEmpty = nonEmptyRunes.isEmpty;
print('Is sequence empty? $isNotEmpty');
}
Is sequence empty? false
In this Dart tutorial, we learned about isEmpty property of Runes: the syntax and few working examples with output and detailed explanation for each example.