JAVA常用方法

来源:互联网 发布:js放烟花特效代码 编辑:程序博客网 时间:2024/05/29 17:40

字符串截取 substring(3)     substring(3,4) 包含开始位置字符,不含结束位置字符,索引从0开始

String customer = “0001111‘’
       if(customer.startsWith("000")){
          System.out.println(customer.substring(3));
}

输出结果:1111

原创粉丝点击