UnicodeSet.Ranges Method

Definition

Provide for faster iteration than by String.

[Android.Runtime.Register("ranges", "()Ljava/lang/Iterable;", "GetRangesHandler", ApiSince=24)]
public virtual Java.Lang.IIterable? Ranges ();
[<Android.Runtime.Register("ranges", "()Ljava/lang/Iterable;", "GetRangesHandler", ApiSince=24)>]
abstract member Ranges : unit -> Java.Lang.IIterable
override this.Ranges : unit -> Java.Lang.IIterable

Returns

Attributes

Remarks

Provide for faster iteration than by String. Returns an Iterable/Iterator over ranges of code points. The UnicodeSet must not be altered during the iteration. The EntryRange instance is the same each time; the contents are just reset.

<b>Warning: </b>To iterate over the full contents, you have to also iterate over the strings.

<b>Warning: </b>For speed, UnicodeSet iteration does not check for concurrent modification. Do not alter the UnicodeSet while iterating.

// Sample code
            for (EntryRange range : us1.ranges()) {
                // do something with code points between range.codepoint and range.codepointEnd;
            }
            for (String s : us1.strings()) {
                // do something with each string;
            }

Java documentation for android.icu.text.UnicodeSet.ranges().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to