I need to convert all lower characters to upper and all upper to lower in some string.
For example
var testString = 'heLLoWorld';
Should be
'HEllOwORLD'
after conversion.
What is the most elagant way to implement this, without saving temp string.
I would be much more better if achieve such result using regular expressions.
Thanks.
testString
, but the additional string was still there.) All of the answers so far end up with copies of the string, 2 with two copies (one in an array and one in a string in one case, both in arrays in the second), one with an explicit copy in a second string. – Danziger