scala string.split does not work

If you use quotes, you’re asking for a regular expression split. | is the “or” character, so your regex matches nothing or nothing. So everything is split.

If you use split('|') or split("""\|""") you should get what you want.

Leave a Comment