[DF-5073] Fix string splitting algorithm