is there a single function in c++ that converts strings from lowercase to uppercase and vice versa? I need to compare two strings case insensitive and I can only convert one of the strings and the other needs to be intact.
is there a single function in c++ that converts strings from lowercase to uppercase
Share
You can use
std::toupperorstd::tolower, in combination withstd::for_eachstd::transform.Edit
You can define a function that performs a case-insensitive comparison of two characters, then use it with
std::equal:You might have to check that the length of the strings is the same before the call to
std::equal.