method to clean the string and break into an array