語言

UCharacterIterator.GetText 方法

定義

多載

名稱 Description
GetText(Char[], Int32)

會用迭代器的底層文字儲存填滿緩衝區,若緩衝區容量不足,則會拋出例外。

GetText(Char[])

便利覆蓋 getText(char[], int) 會提供 0 的偏移。

GetText(Char[], Int32)

會用迭代器的底層文字儲存填滿緩衝區,若緩衝區容量不足,則會拋出例外。

[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

參數

fillIn
Char[]

一組字元陣列用來填充底層的 UTF-16 程式碼單元。

offset
Int32

在陣列中開始放置資料的位置。

傳回

為方便而增加的填充程式碼單元數量

屬性

備註

會用迭代器的底層文字儲存填滿緩衝區,若緩衝區容量不足,則會拋出例外。 填充緩衝區的容量至少應等於透過呼叫 getLength()) 所獲得的迭代器文字長度。 <b>使用頻率:</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 文件 android.icu.text.UCharacterIterator.getText(char[], int)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

GetText(Char[])

便利覆蓋 getText(char[], int) 會提供 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

參數

fillIn
Char[]

一組字元陣列用來填充底層的 UTF-16 程式碼單元。

傳回

為方便而增加的填充程式碼單元數量

屬性

備註

便利覆蓋 getText(char[], int) 會提供 0 的偏移。

Java 文件 android.icu.text.UCharacterIterator.getText(char[])。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於