Code:
/*qstring object/* newText = arg1; if(newText.size() > 0) if(newText[newText.length()-1].isLetter()) { for(int i{0}; i < vowels.length()-1; i++) { if(newText[newText.length()-1] == vowels[i]) { newText[newText.length()-1] = vowels[i+1]; ui->lineEdit->setText(newText); return; }
vowels[i+1] indexes the last element of the Qstring, not the element one over from i. Why is this?
Also, is there a shorter way to reference the last element of a Qstring.