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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

left justified and remove leading zeros.

Status
Not open for further replies.

binzer33

MIS
Jun 6, 2000
6
US
I need some suggestions on removing leading zeros in a string. I know how to remove leading white spaces but not sure of the syntax of removing leading zeroes in a string.
 
Try the following:
Code:
$str = "0000456";
$str =~ s/^0+//;
Cheers, Neil :cool:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top