B
Brian Henry
Which one is better to use? CInt(string) or Integer.Parse(string)? thanks!
* "Brian Henry said:Which one is better to use? CInt(string) or Integer.Parse(string)? thanks!
Which one is better to use? CInt(string) or Integer.Parse(string)? thanks!
* "Brian Henry said:been trying to knock out all the old vb stuff out of my head so sounds like
the parse one is good to go with![]()
* "The Grim Reaper said:I agree that Integer.Parse is the wrong thing to use - but CType(xx,
Integer) is functionally identical to CInt - and if you happen to not have
Microsoft.VisualBasic referenced... it's fine![]()
* "Brian Henry said:any reason specific reason why you suggest i should use CInt instead of the
framework versions? I'm trying to maintain as much compatability in tearms
of code with C# incase they ever want this code directly coverted over to
it..
I would worry about conversion when the conversion actually happened,I'm trying to maintain as much compatibility in terms
of code with C# incase they ever want this code directly converted over to
it..
Brian Henry said:any reason specific reason why you suggest i should use CInt instead of the
framework versions? I'm trying to maintain as much compatability in tearms
of code with C# incase they ever want this code directly coverted over to
it..
Brian Henry said:Which one is better to use? CInt(string) or Integer.Parse(string)? thanks!
* Marc said:thanks!
Another thing to consider is that CInt will convert the string
"1,000", whereas Integer.Parse will not; you'll get an exception.