;+ ; NAME: ; remove_char ; ; ; PURPOSE: ; remove a character from a string, ; this is a unitility routine for make_tag_valid ; ; ; INPUTS: ; tag_in: input string to remove character from ; char: character to remove from string ; ; ; OUTPUTS: ; string with the character removed ; ; ; EXAMPLE: ; IDL> print, remove_char('Hello World', 'l') ; Heo Word ; ; ; ; MODIFICATION HISTORY: ; ; Mon Apr 7 21:21:32 2008, Brian Larsen ; ; pulled out of make_tag_valid to be a standalone routine ; ; Wed Feb 13 18:50:31 2008, Brian Larsen ; ; documented, written prevously ; ;- FUNCTION remove_char, tag_in, char tag = tag_in IF strmatch(tag, '*'+char+'*') THEN BEGIN ans = strsplit(tag, char, /extract) ;; put it back together tag='' FOR i=0l, n_elements(ans)-1 DO tag += ans[i] ENDIF RETURN, tag END
Disclaimer