Java字符串是一系列的Unicode字符序列,但是,它却常常被误认为是char序列。于是,我们经常这样来遍历字符串:
package testchar;
public class TestChar2 {
public static void main(String[] args) {
String s = "Aß東
本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-08/121080.htm
|
背景:
阅读新闻
Java 正确遍历字符串
Java字符串是一系列的Unicode字符序列,但是,它却常常被误认为是char序列。于是,我们经常这样来遍历字符串: package testchar; public class TestChar2 { 本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-08/121080.htm
|
最新资讯
|