how to search string and ignore cases?

hi,
i do have a string (file.txt) and use str.find for search. however, i would prefer to have a case independent search and the translation into capitals or lower letters by std::toupper or std:tolower seems to work but i guess smb knows better ways. i do not need a code - just a hint :)
cheers m
The find function will search for a specific string, but it will be case sensitive.

You could read the words from the file into a string, and make that string lowercase (a simple for-loop will accomplish this). You could then use 'find' with your new lowercase string.
smb == server message block?

Case insensitive compare FAQ
http://www.cplusplus.com/faq/sequences/strings/ci-compare/

that will keep me busy,
thx a lot,
cheers m
Topic archived. No new replies allowed.