Raise exception for invalid UTF-8 encoded string while working with regexp

Moved string split method to individual string18 and string19.

String19 split method checks for valid UTF-8 encoding when a string is being split with regexp