The `followedBy` method in Dart returns the lazy concatenation of this iterable and another iterable.
The syntax of Runes.followedBy() method is:
Iterable<int> followedBy(Iterable<int> other)
This followedBy() method of Runes returns the lazy concatentation of this iterable and other
.
Parameter | Optional/Required | Description |
---|---|---|
other | required | Another iterable to concatenate with this iterable. |
Runes.followedBy() returns value of type Iterable<int>
.
In this example,
first
and second
, from the strings 'Hello' and ' World' respectively.followedBy
method to concatenate the two sequences.void main() {
Runes first = Runes('Hello');
Runes second = Runes(' World');
Iterable<int> combined = first.followedBy(second);
print('Combined sequence: $combined');
}
Combined sequence: (72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100)
In this example,
numbers
from the string '12345'.moreNumbers
containing numbers 6 to 10.followedBy
method to concatenate the sequence with the list.void main() {
Runes numbers = Runes('12345');
List<int> moreNumbers = [6, 7, 8, 9, 10];
Iterable<int> combined = numbers.followedBy(moreNumbers);
print('Combined sequence: $combined');
}
Combined sequence: (49, 50, 51, 52, 53, 6, 7, 8, 9, 10)
In this Dart tutorial, we learned about followedBy() method of Runes: the syntax and few working examples with output and detailed explanation for each example.