Forum Discussion
mraful_64014
Nimbostratus
Feb 12, 2015reverse a string or list
The iRules TCL implementation does not have a string reverse or list lreverse function. Any ideas on how I could accomplish that? I'm capturing a DNS PTR query and reversing the result of the DNS::q...
Michael_Jenkins
Cirrostratus
Feb 12, 2015A method I've used to reverse order a delimited string would be like this (tested in
tclsh)
set strOrig "aaa.bbb.ccc.ddd"
set listOrig [split $strOrig "."]
set listReversed [list ]
for {set i [llength $listOrig]} {[incr i -1] >= 0} {} {lappend listReversed [lindex $listOrig $i]}
set strReversed [join $listReversed "."]
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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