Support of newest version of swift

Newest version of swift doesn't support string.positionOf?
 - There might be a smarter way, but that code should do the exact same as the previous code.