1 String str="asdfghjklzxcvbnmqwertyuiop"; 2 if(str.indexOf("asd")==0); 3 { 4 System.out.println("判断字符串的开头为:"+str.indexOf("asd")); 5 } 6 System.out.println("判断字符串的结尾为:"+str.indexOf("p"));
曦~妍 |
|
||
![]() |
|
Copyright © 2024 曦~妍
Powered by .NET 8.0 on Kubernetes |