/** * Created by xfyou on 2016/11/4. */ public class SubstringDemo { public static void main(String[] args) { String a = "Java is great."; System.out.println(a); System.out.println(a.substring(5)); System.out.println(a.substring(5, 7)); // Java的整个字符串的结束索引在最后一个字符之外 System.out.println(a.substring(5, a.length())); System.out.println(a.indexOf('.')); System.out.println(a.length()); } }
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/15993.html