Add generic string splitting function.