This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var alpha = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "U", "v", "w", "x", "y", "z", "a"]; | |
var str = "This Is A "; | |
//var LetterChange = function(str) { | |
var newStr = str.toLowerCase().split(""); | |
for (var i = 0;i<newStr.length;i++) { | |
var j=0; | |
while (newStr[i] != alpha[i] && j<26) | |
{ j++ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var alpha = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "U", "v", "w", "x", "y", "z", "a"]; | |
var str = "This Is A nEw sTriNg of TexT "; | |
//var LetterChange = function(str) { | |
var newStr = str.toLowerCase().split(""); | |
for (var i = 0;i<newStr.length;i++) { | |
j=0; | |
while (newStr[i] != alpha[j] && j<26) | |
{ j++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var alpha = ["b", "c", "d", "E", "f", "g", "h", "I", "j", "k", "l", "m", "n", "O", "p", "q", "r", "s", "t", "U", "v", "w", "x", "y", "z", "A", "b"]; | |
var str = "This Is A nEw sTriNg of TexT"; | |
//var LetterChanges = function(str) { | |
var newstr = str.toLowerCase().split(""); | |
for (var i=0;i<newstr.length;i++) { | |
var j=0; | |
while (newstr[i] != alpha[j] && j<26) { | |
j++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var alpha = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "a", "b", "c"]; | |
var str = "this is a new string of text"; | |
var LetterChanges = function(str) { | |
var newstr = str.split(""); | |
for (var i=0;i<newstr.length;i++) { | |
var j=0; | |
while (newstr[i] != alpha[j] && j<alpha.length) { | |
j++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var alpha = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "a", "b", "c"]; | |
var LetterChanges = function(str) { | |
var newstr = str.split(""); | |
for (var i=0;i<newstr.length;i++) { | |
var j=0; | |
while (newstr[i] != alpha[j] && j<alpha.length) { | |
j++; | |
} | |
newstr[i] = alpha[j+1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = "this is a call to all my mass resignation" | |
newstr = str.split(" "); | |
for (var i=0;i<newstr.length;i++) { | |
words = newstr[i].split(""); | |
for (var j = 1;j<words.length;j++) { | |
var splits = words[i].split("") | |
var splits = splits[0].toUpperCase(); | |
var splits = split.join(""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LetterCapitalize(str) { | |
var splits = str.split(" "); | |
for (var i=0;i<splits.length;i++) { | |
var tempvar = []; | |
tempvar = splits[i].split("") | |
var captemp = tempvar[0].toUpperCase(); | |
tempvar[0] = captemp; | |
tempvar = tempvar.join(""); | |
splits[i] = tempvar; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = "xxoo"; | |
function palins(str) { | |
if (str.length%2==1) { | |
return false; | |
} else { | |
var array = str.split(""); | |
var yarra = str.split("").reverse(); | |
for (var i=0;i<array.length/2;i++) | |
if (array[i] !== yarra[i]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function palins(){ | |
var array = str.split(""); | |
var yarra = str.split("").reverse(); | |
for (var i=0;i<array.length/2;i++) | |
if (array[i] !== yarra[i]) { | |
return false;} | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function each (obj, cmd) { | |
for (var i in obj) { | |
cmd(obj[i]) | |
} | |
} | |
each([1,2,3], console.log) | |