判斷是否以指定的字符串開頭或結尾

可使用String 類中的startsWith() 方法和endsWith() 方法,分別判斷一個字符串是否以指定字符串爲開頭或結尾。java 【範例5-16 】  判斷是否以指定的字符串開頭或結尾 public class  StringMethod02{   public static void main(String[] args) {   String str="StringMethod0
相關文章
相關標籤/搜索