Strings | Arrays | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
01234567890123456789 s = "ABCdefghijklmnop"; ==> ABCdefghijklmnop s.substring(3,7) ==> defg s.slice(3,7) ==> defg s.substr(3,7) ==> defghij s.substring(3); s.substr(3) ==> defghijklmnop s.charAt(5) ==> f s.search( /def/ ) ==> 3 s.search( /dfe/ ) ==> -1 s.match( /f[fgh]/g) ==> fg s.replace(/[Bh][^em]*/g," XXX ") ==> A XXX efg XXX mnop s.replace( /[d-i,l-n]/g, "" ) ==> ABCjkop s.replace( /([dl-n])/g,"{$1}") ==> ABC{d}efghijk{l}{m}{n}op s.charCodeAt(1) ==> 66 String.fromCharCode(66) ==> B s.length ==> 16 s.split("efg") ==> ABCd,hijklmnop s.split(/[cf]/i) ==> AB,de,ghijklmnop s.toLowerCase() ==> abcdefghijklmnop s.toUpperCase() ==> ABCDEFGHIJKLMNOP s.indexOf("f") ==> 5 s.lastIndexOf("f") ==> 5 isFinite(2/3) ==> true isNaN(s) ==> true Number(" 12.34") ==> 12.34 parseFloat(" 12.34") ==> 12.34 parseInt(" 12.34") ==> 12 "dprint ONLY:" ==> dprint ONLY: "XX"+"XX".big() ==> XXXX "XX"+"XX".bold() ==> XXXX "XX"+"XX".fontcolor("red") ==> XXXX "XX"+"XX".fontsize(5) ==> XXXX "XX"+"XX".italics() ==> XXXX "XX"+"XX".link() ==> XXXX "XX"+"XX".small() ==> XXXX "XX"+"XX".strike() ==> XX "XX"+"XX".sub() ==> XXXX "XX"+"XX".sup() ==> XXXX |
|