Tuesday, May 7, 2013

Find the ASCII value of a string using CSharp (C#)


ASCII - The American Standard Code for Information Interchange. The below sample is a example for retrieving the ASCII value of a given string.
C# Code:
  1. String input = "ENTER YOUR INPUT STRING HERE";
  2. String output = "";
  3. foreach (char c in input)
  4. {
  5. output = output + (byte)c;
  6. }
  7. Console.WriteLine(output);

No comments:

Post a Comment