public class SplitStr {
public static void main(String []args) {
String str1 = "This | is | My | Account | For | Java|";
String str2 = "This / is / My / Account / For / Java/";
// String[] arr = str.split("|");
for(String item : str1.split("|")) {
System.out.print(item);
}
}
}
The program is working correctly with String str2 but it is not working with String str1 What are the possible flows in this program?