I receive a string from an external interface which holds an INT32 value. This value represents “-100” – a signed int – and thus, looking like this string “4294967196”.
If it would look like “-100” I could use Int32.TryParse() to cast it to a signed value.
But in my case it interprets the values as is and tells me that the value is too big (>2.147.483.647).
Any workaround to get this working? How to tell the parser that the leading 1 is not a number?
Edit: Sorry for being inaccurate. The value I receive is a string that looks like this “4294967196”. It represents an Uint32 with the value -100. If the interface would return a string holding “-100” it would be possible to just use Int32.TryParse(). That’s what I was trying to express.
Use
uint.TryParse()and cast the result toint.