Java String Split by “|”
You must use: String [] temp = s.split(“\\|”); This is because the split method takes a regular expression, and | is one of the special characters. It means ‘or’. That means you are splitting by ” or ”, which is just ”. Therefore it will split between every character. You need two slashes because the … Read more