dimanche 16 septembre 2018

Index out of bounds in an if statement

I am wondering why I am getting index out of bounds even in an if statement. Should not the code not simply execute if it is false and go after the if block?. I have the following code, and its is giving me the IndexOut of range Exception.

if (rhs[0] == '+')
    {
                rhs = rhs.Replace("+", "");
    }


//Some code here

Aucun commentaire:

Enregistrer un commentaire