Newbie Questions: How to remove the leading zeros in tcl

Homepage Clovertech Forums Read Only Archives Cloverleaf Tcl Library Newbie Questions: How to remove the leading zeros in tcl

  • Creator
    Topic
  • #50716
    Shu Chen
    Participant

    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||

Viewing 0 reply threads
  • Author
    Replies
    • #67226
      garry r fisher
      Participant

      Hi,

      Use the string trim commands or more specifically trimleft

      set iData 0001234

      set oData [string trimleft $iData 0]

      returns 1234

      Regards

      Garry

Viewing 0 reply threads
  • The forum ‘Tcl Library’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,129
Forums
28
Topics
9,301
Replies
34,447
Topic Tags
288
Empty Topic Tags
10