Parsing strings to create data types
Structure
Conversion Method
Decimal
static decimal Parse(string str)
Double
static double Parse(string str)
Single
static float Parse(string str)
Int64
static long Parse(string str)
Int32
static int Parse(string str)
Int16
static short Parse(string str)
UInt64
static ulong Parse(string str)
UInt32
static uint Parse(string str)
UInt16
static ushort Parse(string str)
Byte
static byte Parse(string str)
SByte
static sbyte Parse(string str)
using System;
class MainClass
{
public static void Main(string[] args)
{
bool myBool = bool.Parse("True");
Console.WriteLine("-> Value of myBool: {0}", myBool);
}
}
Output -> Value of myBool: True
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|