Strips spaces at the front or end of the tag for database storing