package wo;
public class Ep2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str=" Where there is a will,there is a way ";
String str1=new String("Hello");
String str2="World";
String str3=Integer.toHexString(1234);
System.out.println(str1);
System.out.println(str2);
System.out.println(str3);
System.out.println(str1+" "+str2+' '+str3);
char a1=str1.charAt(0);
String st1=str1.concat(str2);
int a2=str.indexOf('e');
int a3=str.length();
String a4=str1.replace('H', 'h');
String a5=str.toLowerCase();
System.out.println(a1);
System.out.println(st1);
System.out.println(a2);
System.out.println(a3);
System.out.println(a4);
System.out.println(a5);
char arr[]=str.toCharArray();
for(char n:arr)
{
System.out.print(n);
}
System.out.println();
System.out.println(str.trim());
}
}
字符串(一)
最新推荐文章于 2023-03-02 15:33:44 发布