I compared both implementations and the one using split() is much cleaner so I'll stick with that considering the performance gain won't be much.