guys can you help me how to validate if the letter is in the last because when i put the letters y, s, ch, sh anywhere in a word it just change.
a. if noun ends in "y" remove the "y" and add "ies"
b. if noun ends in "s", "ch", "sh" add "es"
c. in all other cases, just add "s".
sample output:
enter singular noun: butterfy
plural noun: butterflies
this mite help
1 2 3 4
|
//This will get you the last character of the string
string str;
int pos = str.length() - 1;
str.substr(pos);
|
Last edited on