Need an easy way to change my string into an integer in c# -


i have string this:

var mystring = "025" 

is there easy way change number?

int mynumber = int.parse(mystring); 

note throw exception if mystring cannot converted int. can use tryparse instead safer

int mynumber if( int.tryparse(mystring, out mynumber){   //conversion ok, , mynumber contains int }else{   //conversion failed. mynumber 0. } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -