Converts a string to an array