0

I have this code that doesn't work:

val words = body.split("""[\s\.,!\?:;"()<>\[\]#$=-\/]+""")

Whenever I run it I got error:

error

How this can be fixed?

3
  • 1
    move - to the end of character class: [...-]. Commented Jun 14, 2019 at 13:49
  • 1
    As @AndreyTyukin said. Just do like this [\s\.,!\?:;"()<>\[\]#$=\/-]+ Commented Jun 14, 2019 at 14:05
  • Thanks guys, can you make it an answer? Commented Jun 14, 2019 at 14:41

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.