怎么计算中英文合并的字符串的长度
怎么计算中英文合并的字符串的长度
import java.io.*;
public class StringTest
{
public static void main(String[] args)
{
String aString = "这是一个测试串,This is a test string.";
String anotherString = null;
try {
anotherString = new String(aString.getBytes("GBK"), "ISO8859_1");
}
catch (UnsupportedEncodingException ex) {
}
System.out.println(aString.length() + "," + anotherString.length());
}
}
粗体字的语句什么意思?