Created
September 13, 2018 07:54
-
-
Save huihut/4aac927e1e5b308db0f4b73ecbcb0e03 to your computer and use it in GitHub Desktop.
CSharp type conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Website: http://www.convertdatatypes.com/Language-CSharp.html | |
# Convert string to bool | |
string vIn = "true"; | |
bool vOut = Convert.ToBoolean(vIn); | |
# Convert string to int | |
string vIn = "0"; | |
int vOut = Convert.ToInt32(vIn); | |
# Convert string to uint | |
string vIn = "0"; | |
uint vOut = Convert.ToUInt32(vIn); | |
# Convert string to long | |
string vIn = "0"; | |
long vOut = Convert.ToInt64(vIn); | |
# Convert string to ulong | |
string vIn = "0"; | |
ulong vOut = Convert.ToUInt64(vIn); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment