Consider the string:
string str="A C# string";
What would be most efficient way to printout the ASCII value of each character in str using C#.
Just cast each character to an int:
for (int i = 0; i < str.length; i++) Console.Write(((int)str[i]).ToString());
2.1m questions
2.1m answers
60 comments
57.0k users