Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
HTML Pages with CSS and JavaScript
trimming a string
kevin schmidt
Ranch Hand
Posts: 85
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I have a
string
of ten digits, some of the strings have leading zeros on them, but I don't want to display them to page, how do I go about removing those leading zeros? TIA.
kevin
Anonymous
Ranch Hand
Posts: 18944
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
function trimLeadingZeros(s) { while(s.charAt(0)=="0") { s = s.substring(1) } return s }
[ February 19, 2002: Message edited by: Bodie Minster ]
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Convert String to BigDecimal
How to keep leading zeros when doing a parseInt
How can we store the values in the DB
Displaying seconds in hh:mm:ss format
String to long datatype conversion problem
More...