String.CodePointCount(Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳該 String中指定文字範圍內的 Unicode 碼點數。
[Android.Runtime.Register("codePointCount", "(II)I", "")]
public int CodePointCount(int beginIndex, int endIndex);
[<Android.Runtime.Register("codePointCount", "(II)I", "")>]
member this.CodePointCount : int * int -> int
參數
- beginIndex
- Int32
索引指向文本範圍的第一個 char 。
- endIndex
- Int32
索引位於文字範圍的最後一個 char 之後。
傳回
指定文字範圍內的 Unicode 碼點數
- 屬性
例外狀況
如果 start length() || start > end
備註
回傳該 String中指定文字範圍內的 Unicode 碼點數。 文字範圍從指定的beginIndex開始,延伸至char索引 。endIndex - 1 因此,文字範圍的長度(以 s 為 char單位)為 endIndex-beginIndex。 文本範圍內的未配對替代者各計一個代碼點。
已在1.5中新增。
Java 文件 java.lang.String.codePointCount(.*int, .*int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
另請參閱
- <xref:Java.Lang.Character.CodePointCount(Java.Lang.ICharSequence%2c+System.Int32%2c+System.Int32)>