trying to split a char

The second example uses a char array and I didn't have an array so I was not able to make it work.

You do.

guix's code is small and faster.