思路:
1、contains() 判断字符串中有没有存在这个字符
2、通过indexOf() 找到字符下标
3、substring() 截取字符串
代码:
public static void main(String[] args) {
String code = "012345.SZ";
System.out.println("before: " + code);
if (code.contains(".")) {
int index = code.indexOf(".");
code = code.substring(0, index);
}
System.out.println("after: " + code);
}



