Forum Discussion
lizunjjg_280139
Nimbostratus
Jan 25, 2019i have a irules question
hi:irules{ set a [getfield [HTTP::header Location] "9480" 2]}
I want to change 9480 to 4 integer variables
- Stanislas_Piro2
Cumulonimbus
Hi,
Is the first part static?
Or is there a static string just before this integer?
- Lee_Sutcliffe
Nacreous
You can use
to split a variable into a list of it's constituent parts. Then usespilt
to return the value of that list elementlindex
set a [split {9480} {}] set a1 [lindex $1 0] set a2 [lindex $1 1] set a3 [lindex $1 2] set a4 [lindex $1 3]
https://wiki.tcl-lang.org/page/split
If you don't know how many elements to expect in the list you can consider using
and iterating through the list in a loopllength
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