lundi 11 novembre 2019

How can I prove whether a char in a string is equal to a spepcific char?

I would like to prove whether the first character in my string is equal to "@". How can I do this? I'm using c#

if (string[1] == "<character>")
                    {
                        Console.WriteLine("TRUE");
                    }

Aucun commentaire:

Enregistrer un commentaire