UCharacterIterator.GetText 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| GetText(Char[], Int32) |
使用迭代器的基础文本存储填充缓冲区(如果缓冲区容量不足以引发异常)。 |
| GetText(Char[]) |
为它 |
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
数组中开始放置数据的位置。
返回
为了方便起见,添加到 fillIn 的代码单元数
- 特性
注解
使用迭代器的基础文本存储填充缓冲区(如果缓冲区容量不足以引发异常)。 填充缓冲区的容量应至少等于通过调用 getLength()获取的迭代器中的文本长度。
用法:
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)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
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 代码单元的字符数组。
返回
为了方便起见,添加到 fillIn 的代码单元数
- 特性
注解
为它 getText(char[], int) 提供偏移量 0 的便利替代。
Java文档android.icu.text.UCharacterIterator.getText(char[])。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。