This is what I need.
var str = "This is an |#|example text!"
str = "This is an "
This is what you want:
var subdividedStringArray = str.componentsSeparatedByString("|#|")
now you have an array with 2 strings, you can access the first one with:
str = subdividedStringArray
str = subdividedStringArray.first