toUpperCase() will convert your existing string to uppercase letters. This means that “tHis” will become “THIS” and “This” will also become “THIS”
However in the filter function you are using .contains() which is not case sensitive. Hence your problem might be lying somewhere else.