I\'m trying to split a string in by the characters \"}{\". However I am getting an error:
> val string = \"{one}{two}\".split(\"}{\")
java.util.r
Well... the reason is that split treats its parameter string as a regular expression.
Now, both { and } are special character in regular expressions.
So you will have to skip the special characters of regex world for split's argument, like this,
val string = "{one}{two}".split("\\}\\{")
// string: Array[String] = Array({one, two})