Alex Rivera | Logout

How to split a string with any whitespace chars as delimiters

Asked 2008-10-22T11:27:17.107
601

What regex pattern would need I to pass to java.lang.String.split() to split a String into an Array of substrings using all whitespace characters (' ', '\t', '\n', etc.) as delimiters?

Edit
Report

1 Answer

37

"\\s+" should do the trick

answered 2008-10-22T11:29:25.247

Your Answer