Java String Split by “|”

ou must use: 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 first one is for escaping the actual \ in the string, since \ is Java’s escape … Read more