package AA;
import java.util.StringTokenizer;
public class LIANXI {
public static void main(String args[]) {
String s=new String("共 和 国 f");
char a[]= {'g','c','d','f','k'};
String g=new String(a,2,2);
String o=s.trim();
System.out.println(g);
String h=s+g;
System.out.println(h);
System.err.println(h.indexOf("f"));
System.out.println(h.charAt((h.indexOf("f"))-3));
System.out.println((h.indexOf("f"))-1);
String text="We are student";
StringTokenizer st= new StringTokenizer(text," te");
StringBuffer sb=new StringBuffer();
int i=1;
while(st.hasMoreTokens()) {
i++;
sb.append(st.nextToken());
}
System.out.println(sb.toString());
}
import java.util.StringTokenizer;
public class LIANXI {
public static void main(String args[]) {
String s=new String("共 和 国 f");
char a[]= {'g','c','d','f','k'};
String g=new String(a,2,2);
String o=s.trim();
System.out.println(g);
String h=s+g;
System.out.println(h);
System.err.println(h.indexOf("f"));
System.out.println(h.charAt((h.indexOf("f"))-3));
System.out.println((h.indexOf("f"))-1);
String text="We are student";
StringTokenizer st= new StringTokenizer(text," te");
StringBuffer sb=new StringBuffer();
int i=1;
while(st.hasMoreTokens()) {
i++;
sb.append(st.nextToken());
}
System.out.println(sb.toString());
}
}