Split multiple delimiters in Java

Büşra GÜL picture Büşra GÜL · Dec 20, 2016 · Viewed 48.9k times · Source

How I can split the sentences with respect to the delimiters in the string and count the frequency of words ?

 String delimiters = "\t,;.?!-:@[](){}_*/";

My text file is:

Billy_Reeves

Smorz

Nationalist_Left_-_Youth

Ancient_Greek_units_of_measurement

Jiuting_(Shanghai_Metro)

Blodgett,_MO

Baekjeong

Matt_Brinkman

National_Vietnam_Veterans_Art_Museum

Answer

AMB picture AMB · Dec 20, 2016

Try with

split("\\t|,|;|\\.|\\?|!|-|:|@|\\[|\\]|\\(|\\)|\\{|\\}|_|\\*|/");

Also

Use String.split() with multiple delimiters