(This may be a duplicate, but I could not find an answer among the pile of similar questions...)
Suppose we have the following command:
% <month> <year> <month> <year>
\newcommand{\timeperiod}[4] {%
#1 #2 -- #3 #4%
}
As long as all arguments are provided, everything works fine. But were one to omit e.g. the second month argument (#3), an extra space would appear between the dash and the ending year:
June 2000 – July 2001
June 2000 – 2001
How could I suppress that extra space? Or better yet, how could I make LaTeX ignore any spacing between empty command arguments?