lundi 6 janvier 2020

Conditional Operation on two int values stored as strings [duplicate]

This question already has an answer here:

How can I implement a logic similar to the below mentioned code base ?

string a = "1";
            string b = "2";

            if (a>=b)
            {
                Console.WriteLine("Greatest is" + a);
            }

This is a simple dummy that I created to achieve my required implementation but I am stuck without a way to compare these two integer values which are stored as a string . As shown I have two strings which has two int values stored I simply want to be able to check which one of the two strings is greater than the other

Aucun commentaire:

Enregistrer un commentaire