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
(System32) 42 % set string "blah1-blah2-blah3"
blah1-blah2-blah3
(System32) 43 % set fields [split $string "-"]
blah1 blah2 blah3
(System32) 44 % lassign $fields field1 field2 field3
(System32) 45 % puts $field1
blah1
(System32) 46 % puts $field2
blah2
(System32) 47 % puts $field3
blah3
(System32) 48 %
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