当前位置: 技术问答>java相关
那个函数可以截取String有效部分 ?
来源: 互联网 发布时间:2015-04-02
本文导语: "x "equals("x") ? Seems not , how to convert "x " to "x" ? | 或着 把 string 变为 char[] 然后再取舍 | trim | String.substring(int start,int end); 如 : String str...
"x "equals("x") ?
Seems not ,
how to convert "x " to "x" ?
Seems not ,
how to convert "x " to "x" ?
|
或着 把 string 变为 char[] 然后再取舍
|
trim
|
String.substring(int start,int end);
如 :
String str = "1234567890";
String substring = str.substring(1,6);
则substring就为123456
呵呵
如 :
String str = "1234567890";
String substring = str.substring(1,6);
则substring就为123456
呵呵
|
String.substring();
|
String x1 = "x ";
String x2 = x1.trim();
// Now x2 = "x"
String x2 = x1.trim();
// Now x2 = "x"