Does C# have int8 and uint8?

Nayana Adassuriya picture Nayana Adassuriya · Jul 25, 2014 · Viewed 51.9k times · Source

I have four questions:

  1. Does C# have int8
  2. If so, how can I convert a string to int8?
  3. Does C# have uint8
  4. If that how can I convert a string to uint8?

Answer

Sergey Kalinichenko picture Sergey Kalinichenko · Jul 25, 2014
  1. Does C# have int8

Yes, it's called sbyte

  1. If so, how can I convert a string to int8?

Call sbyte.Parse or sbyte.TryParse

  1. Does C# have uint8

Yes, it's called byte

  1. If that how can I convert a string to uint8?

Call byte.Parse or byte.TryParse