Forum Discussion
String Trim returning odd results
I am using a variable assign action in an APM policy to remove leading/trailing spaces from the username entered into the logon page.
session.logon.last.username = expr { [string trim [mcget {session.logon.last.username}] ] }
For the most part this works fine, but there are some usernames that being unexpectedly altered by this function. Note that all usernames are comprised of numbers, not letters.
The following are some examples of how the username looks before and after this variable assign:
02045604 --> 543620 03276501 --> 884033
Any idea why this would be happening?
Is the username variable possibly being treated as an integer instead of a string?
- Stanislas_Piro2Cumulonimbus
Hi,
Try
expr { "[string trim [mcget {session.logon.last.username}] ]" }
Numbers are converted to integer if you don't add quote
Recent Discussions
Related Content
* 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