Forum Discussion
swabbies_112156
Nimbostratus
Jan 09, 2013help with syntax for trim command
Hello.
I am trying to sort out the correct syntax for using the trim function to get rid of any whitespace at the end of value.
exsting code: set cmd [ URI::query [string tolower [...
hoolio
Cirrostratus
Jan 09, 2013Hi Ben,
The user-agent should be URI encoding the space into a %20 before sending the HTTP request. String trim works fine when you want to trim any set of individual characters but not a specific sequence. If you want to remove the %20's from a parameter value, you can try this:
set cmd [string map {%20 ""} [URI::query [string tolower [HTTP::uri]] " "] command]]
Just make sure to test the config load after you make the iRule change using 'b verify load' or 'tmsh load sys config verify'. There have been some parser bugs when loading the config with these types of commands. If you see any issues reply back here and I'll try giving you an alternate format to do the same thing.
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects