Remove leading zero's from alphanumeic text

Posted by cedar715 on Stack Overflow See other posts from Stack Overflow or by cedar715
Published on 2010-05-10T06:29:25Z Indexed on 2010/05/10 6:34 UTC
Read the original article Hit count: 188

I've seen questions to prefix zeros here in SO. But not the other way !!

Can you guys suggest me how to remove the leading zeros in alphanumeric text. Are there any built-in APIs or do I need to write a method to trim the leading zero's?

Example:

01234 converts to 1234
0001234a converts to 1234a
001234-a converts to 1234-a
101234 remains as 101234
2509398 remains as 2509398
123z remains as 123z
000002829839 converts to 2829839

© Stack Overflow or respective owner

Related posts about java

Related posts about alphanumeric