Forum Discussion

Christopher_J_B's avatar
Christopher_J_B
Icon for Nimbostratus rankNimbostratus
Nov 08, 2009

Removing whitespace HTTP:payload

Parsing a XML POST and sending to specific pool based upon the call using findstr - my issue is sometimes I am getting XML calls with whitespace/newline or not.

 

 

Does a method/function exist to remove whitespace or newline characters within a variable (containing several lines/characters of information)?

2 Replies

  • Hi Christopher,

     

     

    You can use string map (Click here) to do string substitutions: [string map [list " " "" "\n" ""] $str]

     

     

    % set str {value with spaces

     

     

    and

     

     

    new lines}

     

     

    % string map [list " " "" "\n" "" "with" "without"] $str

     

    valuewithoutspacesandnewlines

     

     

    Aaron
  • There is article that talks about string commands that goes into some details about whitespaces

     

     

    http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=339

     

     

    Thanks,

     

    CB