string builders
Thu Jan 18 2024 18:22:13 GMT+0000 (Coordinated Universal Time)
Saved by
@login
public class StringBuilders {
public static void main(String[] args) {
String str="ABCDEFGH";
System.out.println("string length="+str.length());
System.out.println("string replace:"+str.replace("ABCDEFGH","abcdefgh"));
System.out.println("Index:"+str.indexOf("D"));
System.out.println("string charat: "+str.charAt(5));
System.out.println("string uppercase: "+str.toUpperCase());
System.out.println("string lowercase: "+str.toLowerCase());
System.out.println("string tostring"+str.toString());
System.out.println("string concat"+str.concat("I"));
//System.out.println("capitalize: "+str.capitalize());
}
}
content_copyCOPY
Comments