日期:2014-05-20  浏览次数:20907 次

java Substring 问题
public static void main(String[] argsStrings){
String test="?9dHPmH6cNdZegysywbYoF8QCspqrtSauaV" +
"3hBygzmz4heMsAON+VSPczAsw7a0YNr2Wub/BpYaG" +
"9gGi1nksAxyh0htT72TMcSJZtMhUru3xqVQklOuwT1" +
"T9zPzEKCu36OQpJHcsnAda1LY3/3rkPD+GReNDqtR3rbRI+O" +
"o621En4SL489ACQus2iCQpmvW42RJoMPqrmv7iAWKNOe" +
"XO9tF9rFMiFb1uMXbXTTQq3u0dYozZipgtLmsla4aNN" +
"Kp+hNuVj21Flat0ktNDfmQXrLqst9UbFvRxtJdTGvTi" +
"ymh7PMrUNT8aVsqaznOfCre5kC5PoqTJtX+KHsWN" +
"M0X4gmn4oQyKvFCNK84TYsrzDFPF+YQ9r2fBHQo" +
"TlxhRcr4BMmaCECrQ7wo6aFEI39dnCooRAijy9" +
"lxoh0ThfxxYbNvlVxaXRhEWm4zfG+KBj/U/jr+X" +
"yh44+aMsnVGe741AyiIVqUGjsC7fG60b5h4F08rQtr" +
"8VFKxyPdcwkmixLgtUkKKaJ0hVAB8dvfm1TPlVA0" +
"jl6oex6AGM1K7Sx0d7hPwLHwvegJ6wr58lcko20" +
"Q+rIpenGkrNkOnYWzTj+D4G5kHcnRvyBrC8pVgk" +
"lifi4wan+9+2rANOrxnRHejuvAdHTE";
String first = test.substring(0,1);
System.out.println(first);

为什么取不到第一位啊,这样first的值为空。求解

------解决方案--------------------
把你的字符串转成2进制,你的前面就是多了一个空字符