Removing "00" from a number.

Okay lets say the number is "00394780" i need to remove the "00" from the number which will make it into "394780".
LVL 1
RevJokerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

themrrobertCommented:
String number = "00394780";

number = (String) (int) number;


try that?
0
RevJokerAuthor Commented:
Found a solution.

string a = "000012340";
string b = a.TrimStart('0');
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RevJokerAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for RevJoker's comment #a38420630

for the following reason:

Found it and works fine.
0
AndyAinscowFreelance programmer / ConsultantCommented:
Just an aside.

>>Okay lets say the number is "00394780"

Actually that is a string not a number.  ANY numeric variable (int, long....) will not have leading zero's, they will only appear if you
a) convert it to a string
b) instruct the formatting of the string to have leading zero's
0
AndyAinscowFreelance programmer / ConsultantCommented:
I've asked for a moderator to accept your answer (trim - which is the simplest way to do what you wanted) as you originally requested - as I said my comment was purely for your information.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual C++.NET

From novice to tech pro — start learning today.