function strnowhitespace,str_in ;+ ; ; STRNOWHITESPACE ; A function that returns the input string, less any whitespace. ; ; Call Sequence: ; Result = STRNOWHITESPACE(STR_IN) ; ; Inputs: ; STR_IN - Input string. ; ; Returns: ; STR_IN, but with leading, trailing, and any spaces that appear in ; the middle removed. ; ; Katie Peek / March 2008 ; ;- if (n_elements(str_in) eq 0) then begin print,' Syntax: Result = StrNoWhitespace(STR_IN) ' return,'' endif str=str_in bits = strsplit(str,' ',/ext) n=n_elements(bits) str_out = bits[0] if (n ge 1) then for i=1,n-1 do str_out = str_out+bits[i] return,str_out end