42

I'm trying to split a string with all non-alphanumeric characters as delimiters yet Java's String.split() method discards the delimiter characters from the resulting array. Is there a way to split a string like the "\W" regex pattern does, yet keep the delimiters?

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
mcjabberz
  • 9,578
  • 10
  • 35
  • 36

0 Answers0