I want 10576.53012.46344.35174 from string

"CompositionClassification|CC000003|01|10576.53012.46344.35174" 

I have index of last occurrence of |, how will i get complete 10576.53012.46344.35174 sub-string from last |

Not familiar with TCL, Suggest solution on this :)

2

1 Answer

If you know the index of the first character you want, and you want from there to the end, you use:

set theSubstring [string range $theString $idx end] 

However in this case I'd use split and lindex, since it looks like a simple delimited list:

set theSubstring [lindex [split $theString "|"] end] 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.