Convert.ToUInt32 Method in C#



Convert a specified value to a 32-bit unsigned integer using the Convert.ToUInt32 method.

The following is our string.

string str = "210";

Now, let us convert it to a 32-bit unsigned integer.

uint res;
res = Convert.ToUInt32(str);

Example

 Live Demo

using System;
public class Demo {
   public static void Main() {
      string str = "210";
      uint res;
      res = Convert.ToUInt32(str);
      Console.WriteLine("Converted string '{0}' to {1}", str, res);
   }
}

Output

Converted string '210' to 210
karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know


Advertisements