import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class JavaBasic {
public static void main(String[] args){
StringBuffer sd = new StringBuffer();
String hhhString="adlkll";
Pattern pattern = Pattern.compile("[A-Za-z]*");
Matcher matcher = pattern.matcher(hhhString);
if (matcher.matches()){
System.out.println("符合要求");
} else {
System.out.println("不符合要求"); //是否符合正则表达式内容
}
// hhhString=hhhString.replace(" ", ",");
String[] ss1=hhhString.trim().split(" ");
System.out.println(ss1.length);
for(int i=0;i<ss1.length;i++){
sd.append(ss1[i]); //字符串连接,如果选lengsh-i,可以确定选第几个字符串
}
System.out.println(sd.toString());
StringBuffer sb = new StringBuffer();
String s = " ab ce as";
String[] ss =s.trim().split(" ");
System.out.println(ss.length);
for(int i=0;i<ss.length;i++){
sb.append(ss[i]); //显示全部自字符
}
System.out.println(sb.toString());
}
}