#How to do the same thing as .charAt(), but with String. ("string.At()"?
1 messages · Page 1 of 1 (latest)
did you at least try to do it with string?
first place to look is always the javadocs
...it's the exact same code
String str = "Leo";
System.out.print(str.charAt(1));
Output:
e
charAt also works the same way with strings
substring?
StringBuilder sb = new String("Leo with a doubt");
String str = sb.substring(0,3);
and if you want a stringbuilder just plug that string in new StringBuilder object
sb = new StringBuilder(sb.substring(0,3));