Names analyzing!!

Hi all,

How can I do this :

when the user enters any name has "w"or "W" as the first letter and "f"or "F" as the last letter, the program whould write "your name has "w" and "f" " ??

thanks
Last edited on
What about

1
2
3
4
5
std::string name;
// ...
if (std::tolower(name[0]) == 'w' && std::tolower(name[name.size() - 1]) == 'f') {
    // output
}
Thank you
Topic archived. No new replies allowed.