请问我想判断字符串以什么开头这样写对不对啊
String string = "theerwiiuo";
Pattern pattern = Pattern.compile("^the");
Matcher m = pattern.matcher(string);
System.out.print(m.matches());
String string = "theerwiiuo";
Pattern pattern = Pattern.compile("^the");
Matcher m = pattern.matcher(string);
System.out.print(m.matches());
Pattern pattern = Pattern.compile("^the.*");
Matcher m = pattern.matcher(string);
System.out.print(m.matches());