判断是否以指定的字符串开头或结尾

可使用String 类中的startsWith() 方法和endsWith() 方法,分别判断一个字符串是否以指定字符串为开头或结尾。java 【范例5-16 】  判断是否以指定的字符串开头或结尾 public class  StringMethod02{   public static void main(String[] args) {   String str="StringMethod0
相关文章
相关标签/搜索