本文首发于微信公众号:程序员乔戈里 public class testT { public static void main(String [] args){ String A = "hi你是乔戈里"; System.out.println(A.length()); } } 以上结果输出为7. 小萌边说边在IDEA中的win环境下选中String.length()函数,使用ctrl+B快捷键进入到String.length()的定义. /** * Returns the length…
/** * 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的…