Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to label the values in C#? Text and number comparison?
How to label the values in C#? Text and number comparison?
Label 1。 Text is a string type, which is what we call a string type. Just like these Chinese characters we input, they are all strings.

And int is a plastic data.

If you want to compare them, you need to convert the string type to the int type. There are several ways to convert a string type to an int type:

Integer = integer. Parse(Label 1。 Text);

TryParse (tag 1. Text, output number)

in num = Convert。 ToInt32 (label. Text);