You can compare two values of the same type.
If you have a string "12" and a number 2, you can convert the string to a number and then compare it with 2.
If your string is "A12", then you won't be able to convert this to a number.
To avoid an error while converting an alphanumeric string to a number, you can use the T
ryParse
method[
^]. This will help you avoid an error while conversion.