Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to truncate a leading 0s

Status
Not open for further replies.

snowingnow

Programmer
Jun 1, 2006
32
CA
Hello, how can i trancate all the leading 0(ZERO)s in a string? what fucntion should i use?Thanks
 
Hi

Tcl documentation said:
string trimleft string ?chars?
Returns a value equal to string except that any leading characters present in the string given by chars are removed. If chars is not specified then white space is removed (spaces, tabs, newlines, and carriage returns).
Code:
string trimleft [green][i]$yourStringVariable[/i][/green] "0"

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top