startsWith 是则返回true,否则返回false String str = "abcdefg"; str.startsWith("a");//返回true str.startsWith("abc");返回true endsWith String str = "abcdefg"; str.endsWith("g");//返回true str.endsWith("efg");返回true