how to increment eacl element in a list ?
eg: incrlist {1 2 3}
=>2 3 4
Answer Posted / gagik sukiasyan
set list {1 2 3}
regsub -all {(\d+)} $list "\[expr \\1 + 1\]" new_list
set result [eval concat "" $new_list]
Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers