remove whitespace and empty elements from array and desired strings