判断以xx开头的字符串

	public static void main(String[] args) {
		String str = "EAN_13,1534651";
		String strHttp = "http://weixing.qq.com";
		System.out.println(str.startsWith("EAN"));
		System.out.println(strHttp.startsWith("http"));
	}

  结果:

	public static void main(String[] args) {
		String str = "EAN_13,1534651";
		String strHttp = "htp://weixing.qq.com";
		System.out.println(str.startsWith("EAN"));
		System.out.println(strHttp.startsWith("http"));

	}

  

posted @ 2019-02-25 11:41  含苞待放会有时  阅读(637)  评论(0编辑  收藏  举报