trims whitespace from ends of string to better detect type of URL