public class Sample {
public static void main(String[] args) {
String str = "AIUEO";
System.out.println(str.substring(0,3)); // ->Ah
System.out.println(str.substring(3)); // ->Eo
System.out.println(str.substring(0, str.indexOf("U"))); // ->Ai
}
}
I can't always remember the movement of the substring, so I write a snippet every time, so I'll write it down.
Recommended Posts