Layer7 API Management

 View Only
  • 1.  Removing trailing spaces

    Posted Jul 08, 2016 05:47 PM

    Does anyone know an easy way to remove trailing spaces from a string context variable?   Perhaps there is a way to do this using regex?



  • 2.  Re: Removing trailing spaces
    Best Answer

    Broadcom Employee
    Posted Jul 09, 2016 12:06 PM

    Hi JoePao,

     

    You can use RegEx here as you mentioned (the 'Evaluate Regular Expression' assertion),

    ie:  [ \t]+$

     

    Here is a screenshot of my setup. The input variable (named 'spaces') contains several trailing white-space characters

     

     

    Regards,

    Joe



  • 3.  Re: Removing trailing spaces

    Broadcom Employee
    Posted Aug 25, 2016 11:59 PM

    for any trailing white space, the regex could also be,

    \s$

     

    Regards,

    Mark