updated with remove leading/trailing whitespace in array convertor