Reply to topic
Convert string to int
eriweb


Joined: 06 Apr 2004
Posts: 68
Reply with quote
Hello all,

I am trying to convert a string to an int in C# and am running to a small issue.

Let's say I have a string that has a value of "0832" and when I convert it using Convert.ToInto32("0832") I get back an int with a value of 832, but I am trying to get the whole thing 0832.

Does any know any other convert methods that can accomplish this?

Thanks.
bobum
Elvis Fanatic
Elvis Fanatic

Joined: 16 Nov 2004
Posts: 746
Location: Montgomery, AL
Reply with quote
0832 IS 832 as an integer - you can't get a zero in the front there if you want it to be an integer - the only way you can evaluate that is to have it be a string.
Convert string to int
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic