A
Alan Silver
Hello,
I'm converting some old VB6 code to use with ASP.NET and have come
unstuck with the Asc() function. This was used in the old VB6 code to
convert a character to its ASCII numeric equivalent.
Is there such a function available in C#? I can see that VB.NET has one,
but I couldn't see how to get at it in C#.
For example, if I have ...
string str = "Hello";
.... how would I do the following (where I have used the VB Asc()
function in my C# pseudocode)...
int sum = 0;
for (int i=0; i:str.Length(); i++) {
sum += Asc(str.Substring(i,1));
}
TIA
I'm converting some old VB6 code to use with ASP.NET and have come
unstuck with the Asc() function. This was used in the old VB6 code to
convert a character to its ASCII numeric equivalent.
Is there such a function available in C#? I can see that VB.NET has one,
but I couldn't see how to get at it in C#.
For example, if I have ...
string str = "Hello";
.... how would I do the following (where I have used the VB Asc()
function in my C# pseudocode)...
int sum = 0;
for (int i=0; i:str.Length(); i++) {
sum += Asc(str.Substring(i,1));
}
TIA