How to Use charCodeAt Method

I want to convert a string into integers regardless of if it’s integers already or characters. From what I’ve see on the interwebz using the charCodeAt method is the right way to do it (please tell me if there’s a better way). I’ve used MSDN methods before but Im confused here on what to import because It doesn’t use a namespace and unity doesn’t recongize it as a built in function.

So basically how do I use the charCodeAt method? Unless there’s a better way of converting letters to numbers.

charCodeAt and related methods are part of JScript (which Unity doesn’t use), not .NET. You can use System.Convert.ToInt32 instead. e.g.,

Debug.Log (System.Convert.ToInt32("abcd"[3])); // Unicode number for "d"