So I really need help with something thats been bugging me for some time now. I have a function which looks like this:
var convertString = function (str){
// Place for additional code here.
return str;};
And what I need this function to do is to convert the string that comes with str.
Example: I need the scentence "I really LOVE JavaScript" to be converted to "i RE#LLY love j#V#sCRIPT"
I have no idea whatsoever how to accomplish this, please help!
var convertString = function (str){
var s = '';
for (var i=0; i<str.length; i++) {
var n = str.charAt(i);
s += (n.toLowerCase()=='a' ? '#' : n == n.toUpperCase() ? n.toLowerCase() : n.toUpperCase());
}
return s;
}