开发者

Total characters (not code units) of a String in Java considering Supplementary Characters

开发者 https://www.devze.com 2023-04-06 05:54 出处:网络
How can you obtain the total characters of a String, considering that it could have supplementary characters which takes 2 code units to be encoded.

How can you obtain the total characters of a String, considering that it could have supplementary characters which takes 2 code units to be encoded.

Example:

String strTest = "a
0

精彩评论

暂无评论...
验证码 换一张
取 消