Updated function to Split strings with any delimiter