Strings and characters

My goal is to get rid of the case distinction, but it outputs:
error: request for member ‘compare’ in ‘thestring.std::basic_string<_CharT, _Traits, _Alloc>::operator[] [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](i)’, which is of non-class type ‘char’


1
2
3
4
5
6
7
8
9
10
11
void decase (string thestring) {
        string lowercase = "abcdefghijklmnopqrstuvwxyz";  
        string uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        for (unsigned int i = 0; !(i > thestring.length()); i++) {
                for (int j = 0; j < 26; j++) {
                        if (thestring[i].compare(i,1,uplets[j]) == 0) {
                                thestring[i] = lowlets[j];
                        };
                };
        };
}
Topic archived. No new replies allowed.