vendredi 28 août 2020

Is there a way to rewrite this?

string toLowerCase(string word)
{

  for (int a = 0; a < word.length(); a++)
  {

      if (word[a] >= 'A' && word[a] <= 'Z')
      {

          word[a] = word[a] + 32;
      }
  }


  return word;
}

Is there another way to code this? It can't be c-strings. Thanks.

Aucun commentaire:

Enregistrer un commentaire