Suppose, set s1 "some4number"
I want to change it to some5number.
I was hoping that this would work :
regsub {(\d)(\S+)} $s1 "[expr \\1 + 1]\\2"
But it errors out. What would be the ideal way to do this in TCL ?
Suppose, set s1 "some4number"
I want to change it to some5number.
I was hoping that this would work :
regsub {(\d)(\S+)} $s1 "[expr \\1 + 1]\\2"
But it errors out. What would be the ideal way to do this in TCL ?
Copyright © 2021 Jogjafile Inc.
The Tcler's Wiki has many neat things. One of them is this:
With that, we can do this:
But this will become less awful in the future with 8.7 (in development). Here's what you'd do with an
apply
-term helper:With a helper procedure instead: