java中檢驗字串中包含某個字元或欄位的方法

mischen520發表於2017-06-06
String str="123abc456";  
	 if(str.indexOf("abc")!=-1){  
	   System.out.println("包含");  
	 }else{  
	    System.out.println("不包含");  
	 }  

相關文章