BorislavBorisov

! String to int to char value in Ascii table

Sep 27th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.29 KB | None | 0 0
  1. using System;
  2. class StringToIntToCharValue
  3. {
  4.     static void Main()
  5.     {
  6.         string number = "0345";
  7.         int a = number.ToString()[0];//по този начин взимаме стойността на чара '0' в ASCII таблицата
  8.         Console.WriteLine(a);//48
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment