Forum Discussion
Jnon
Mar 30, 2018Nimbostratus
string variable
Need to create variable from string with multiple delimiters
Example: TXT=my Variable Value, with spaces and other characters, TXT2=More Data for Second variable, TXT3=Additional info,
co...
crodriguez
Mar 30, 2018Ret. Employee
How about this? Split at the string ", TXT" first (there's a space between the command the the T) and grab what's to the right of that string. Using your examples, after the first split, you wind up with:
TXT=my Variable Value, with spaces and other characters
2=More Data for Second variable
3=Additional info,
Then, split each substring at "=" and grab everything to the right of that character, giving you:
my Variable Value, with spaces and other characters
More Data for Second variable
Additional info,
On the very last substring, you may need to remove the last comma. I wasn't sure if the last TXTn= parameter would contain a command at the end or not.
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