Forum Discussion
Matt_Breedlove_
Nimbostratus
May 23, 2014Splitting a delimited string into multiple variables in one line with TCL split versus GetField
This is a breeze to do in perl...
$string=="blah1-blah2-blah3";
($field1, $field2, $field3) = split(/-/,$string,3);
In TCL there is the split function, but I don't see any references to assig...
John_Alam_45640
May 23, 2014Historic F5 Account
I don't think the foreach is needed.
This should be all you need.
set string "blah1-blah2-blah3"
set fields [split $string "-"]
lassign $fields field1 field2 field3
getfield is not TCL , it is iRules only.
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