am_gli_287451
Dec 11, 2017Nimbostratus
string trim generating strange results
Hi,
I have an issue with one of my string manipulations with variables:
set test [ACCESS::session data get session.http.last.response_cookie]
set test [lindex [split $test "|"] 0]
set test [string trim $test "Test="]
So, my cookie is built up like this:
- example: Test=ZTR(abc1234-1);ABC(qwe12314);|version=1;...
- example: Test=OEZZV(abc1234);ABC(qwe12314);|version=1...
In the first example, my $test ends up being correctly shown as "ZTR(abc1234-1);ABC(qwe12314);". In the second one, $test ends up being "ZZV(abc1234);ABC(qwe12314);".
So the "OE" is stripped away, although it shouldn't be. I've read about some odd results with trim when using numbers and I assume that this occurs because the OE (letter O, not number 0) represents some kind of value that is handled by the F5 differently.
But can anyone tell why and how to mitigate this? Is it possible to handle the variable as a string variable or similar, so that these changes of the values are not done?
Thanks in advance!