split method for a string in c