call trim() method on strings for validation