Forum Discussion
Dharshana_11419
Nimbostratus
Nov 20, 2017findstr - sub string of last occurrence of a character to the end of the string
Hi,
Can someone please help me how to find the last occurrence of a character and get a sub string from thereafter to the end of the string using findstr?
i.e from XXX-GHDF-12XD45 i need to match 12X...
Stanislas_Piro2
Cumulonimbus
Nov 20, 2017set str "XXX-GHDF-12XD45"
set sub_str [string range $str [string last "-" $str]+1 end]
or
set str "XXX-GHDF-12XD45"
set sub_str [lindex [set str_list [split $str "-"]] [llength $str_list]-1]
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
