Forum Discussion

dexterstu's avatar
dexterstu
Icon for Nimbostratus rankNimbostratus
Apr 21, 2017

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?

 

  • Hi,

    Try

     expr { "[string trim [mcget {session.logon.last.username}] ]" }     
    

    Numbers are converted to integer if you don't add quote