Udostępnij za pośrednictwem


UCharacterIterator.GetText Method

Definition

Overloads

GetText(Char[], Int32)

Fills the buffer with the underlying text storage of the iterator If the buffer capacity is not enough a exception is thrown.

GetText(Char[])

Convenience override for getText(char[], int) that provides an offset of 0.

GetText(Char[], Int32)

Fills the buffer with the underlying text storage of the iterator If the buffer capacity is not enough a exception is thrown.

[Android.Runtime.Register("getText", "([CI)I", "GetGetText_arrayCIHandler", ApiSince=24)]
public abstract int GetText (char[]? fillIn, int offset);
[<Android.Runtime.Register("getText", "([CI)I", "GetGetText_arrayCIHandler", ApiSince=24)>]
abstract member GetText : char[] * int -> int

Parameters

fillIn
Char[]

an array of chars to fill with the underlying UTF-16 code units.

offset
Int32

the position within the array to start putting the data.

Returns

the number of code units added to fillIn, as a convenience

Attributes

Remarks

Fills the buffer with the underlying text storage of the iterator If the buffer capacity is not enough a exception is thrown. The capacity of the fill in buffer should at least be equal to length of text in the iterator obtained by calling getLength()). <b>Usage:</b>

UChacterIterator iter = new UCharacterIterator.getInstance(text);
                    char[] buf = new char[iter.getLength()];
                    iter.getText(buf);

                    OR
                    char[] buf= new char[1];
                    int len = 0;
                    for(;;){
                        try{
                            len = iter.getText(buf);
                            break;
                        }catch(IndexOutOfBoundsException e){
                            buf = new char[iter.getLength()];
                        }
                    }

Java documentation for android.icu.text.UCharacterIterator.getText(char[], int).

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

GetText(Char[])

Convenience override for getText(char[], int) that provides an offset of 0.

[Android.Runtime.Register("getText", "([C)I", "", ApiSince=24)]
public int GetText (char[]? fillIn);
[<Android.Runtime.Register("getText", "([C)I", "", ApiSince=24)>]
member this.GetText : char[] -> int

Parameters

fillIn
Char[]

an array of chars to fill with the underlying UTF-16 code units.

Returns

the number of code units added to fillIn, as a convenience

Attributes

Remarks

Convenience override for getText(char[], int) that provides an offset of 0.

Java documentation for android.icu.text.UCharacterIterator.getText(char[]).

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