[Solved] Why you can’t just paste method to make it work?

[ad_1]

String is immutable. so, sub.toUpperCase() doesn’t change the string internals. It just returns you a new string value that is uppercased:

To uppercase sub, rather assign sub to the result of the toUpperCase() method like so:

sub = sub.toUpperCase();

That way, you return a new uppercase string.

[ad_2]

solved Why you can’t just paste method to make it work?