[ Zverko27 @ 18.06.2005. 19:43 ] @
Npr imam jedan string = "jjasdkjlasdjkasjkjkaskjasjk" Kaze "Calculate the total of the ASCII values of all the characters in the string and convert the total of ASCII values into a string??!! |
[ Zverko27 @ 18.06.2005. 19:43 ] @
[ ambimoustrous @ 19.06.2005. 19:26 ] @
"ASCII" = 65 + 83 + 67 + 73 + 73 = 361
[ dusty @ 20.06.2005. 10:37 ] @
Pazi, posto je string u pitanju koji moze ali ne mora da bude unicode, moras da ga 'konvertujes' u ASCII, nesto kao:
Code: private static string CheckSum(string strASCII) { int checkSum = 0; foreach(byte b in System.Text.Encoding.ASCII.GetBytes(strASCII)) checkSum += (int)b; return checkSum.ToString(); } Je'l radi posao ? ![]() [ Zverko27 @ 20.06.2005. 19:41 ] @
Ma fercera :)
Jedno veliko hvala. Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|