I want my program to accept search strings, for example: blue & berry (to find both of the words) bed | sleep | pillow(to find first one or the second one etc) When i recieve these string into my program, i use String.split() With "&" or "|" as separator.
String[] splited = input.split("|");
It works fine in the first case, but in the second case in separates each letter in the words, for example: b e d. Can i do something for it to be separated by words with this symbol, not just splited letter by letter?