Forum Discussion
Humair_167681
Nimbostratus
Apr 14, 2015String map help
Hi all,
Could you please explain the difference between the two commands below?
HTTP::uri [string map "/$customer/ /" [HTTP::uri]]
HTTP::uri [string map {"/$customer/" "/"} [HTTP::uri]...
Apr 14, 2015
I believe they are functionally equivalent. But, the second command is expressly setting the correct type for the mapping parameter. Most likely is that TCL is seeing you are passing in a string in the first command and trying to coerce it to an list of search/replace strings which that parameter is supposed to represent. Since you have a space in that string, it's convering it to the equivalent of 2.
In an example with the TCL interpreter (tclsh), here's something similar:
% set s 123456
123456
% string map {1 a} $s
a23456
% string map "1 a" $s
a23456
-Joe
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