Extract substring between given strings
Answer #1 100 %I don't think removeSurrounding
applies here, as you can only remove text with that if you know exactly the entire prefix
and suffix
to remove.
I'd go with this, as it's very easy to read:
val result = data.substringAfter("be_fr=").substringBefore(';')