Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the charCodeAt() equivalent in C#?

What is the charCodeAt() equivalent in C#?

Current Code:

   string outString="";
    for (var i = 0; i < inpString.Length; i++)
    {
    outString += inpString.charCodeAt(i).toString(); //i need to replaced charCodeAt(i) with equalent c# code
    }

How can i do this in C#?

like image 705
user3432064 Avatar asked Mar 21 '14 05:03

user3432064


1 Answers

Try out this

string outString="";

for (var i = 0; i < inpString.Length; i++)

{

outString+= ((int)inpString[i]).ToString();

}
like image 143
Kailas Avatar answered Sep 18 '22 13:09

Kailas