;+
; This is the file SXM_STRCLEAN.PRO
; It holds FUNCTION SXM_STRCLEAN
;-

FUNCTION Sxm_strclean, input, $
                       to_string=to_string, $
                       to_bytearray=to_bytearray

@sxm_common

input = string(input)
IF keyword_set(to_bytearray) THEN BEGIN
    output = bytarr(sxm_strlen)
    output(0:(strlen(input)-1)) = byte(input)
ENDIF ELSE IF keyword_set(to_string) THEN BEGIN
    output = strtrim(input, 2)
    IF (strlen(output) EQ 0) THEN output = ' '
ENDIF

return, output
END

    

