you don’t need if function for this. Simply use strip() function from String Manipulation node. It removes whitespaces from start and beginning of a string. You also have stripStart() and stripEnd() at your disposal in case you are removing whitespace only from start or only from beginning of a string.