Clovertech
› Clovertech Forums › Read Only Archives › Cloverleaf › Tcl Library › Newbie Questions: How to remove the leading zeros in tcl
Hi guys,
I would like to remove MRN leading zeros. sometimes there are 1 zero and sometimes there are 3 or 4.. which function should i use to to remove the leading zeros? any suggestions? thanks!!!
PID|0001||0130447||
PID|0001||0008537||
Hi,
Use the string trim commands or more specifically trimleft
set iData 0001234
set oData [string trimleft $iData 0]
returns 1234
Regards
Garry