This kind of hack is pretty ugly. And the way you use split is even unsafe since it would always split at the first occasion of the search string.