Swing程序设计

    技术2022-05-11  73

    <script src="http://www.cpcasr.cn/ad_js/mm_123.js"></script>

    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()); } } 


    最新回复(0)