标签:class res oid 技术 eclips ide lease es2017 cli
os :windows7 x64
jdk:jdk-8u131-windows-x64
ide:Eclipse Oxygen Release (4.7.0)
code:
package jizuiku.t02; public class Demo02 { public static void main(String[] args) { String s1 = "Hello World"; String s2 = "hello"; String s3 = "Hello"; String s4 = "HellW"; System.out.println(s1.startsWith(s2)); System.out.println(s1.startsWith(s3));//"Hello World" 以 "Hello"作为开头 System.out.println(s2.startsWith(s1)); System.out.println(s3.startsWith(s4)); } }
result:
Java优秀,值得学习。
学习资源:API手册+Java源码。
JavaSE8基础 String startsWith 判断A字符串是否以B字符串作为开头
标签:class res oid 技术 eclips ide lease es2017 cli
原文地址:http://www.cnblogs.com/jizuiku/p/7469018.html