Converting fastParseInt to JS from C

I have found a cool script to convert int string to an integer, it is 10 times faster than int.Parse because it doesnt have to search for - and spaces and returns in the string.

I started to convert it to JS, except that JS doesnt add a char to an int (can’t add result and letter at the end), so is there a .net method for it? Thankyou

function  IntParseFast( value : String) : int
{
	var result : int = 0;
	for (var i = 0; i < value.Length; i++)
	{
	    var letter : char = value*;*

_ result = 10 * result + (letter);_

  • }*
  • return result;*
    }

Try char.GetNumericValue():

 result = 10 * result + char.GetNumericValue(letter);