c# - Unhandled exception of type System.FormatException -


when start program, visual studio 2015 (i use wpf , c#) gives me unhandled exception of type 'system.formatexception' occurred in mscorlib.dll.

string ascii = string.empty;  (int = 0; < dec.length; += 3) {     ascii += convert.tochar(convert.tobyte(dec.substring(i, 3))); // exception occurs here. } 

there non-numeric characters in string. causing formatexception.

according msdn:

value not consist of optional sign followed sequence of digits (0 through 9).


Comments