<script>
var str = new String('012a210');
console.log(str);
console.log(str.indexOf('2'));//2
console.log(str.lastIndexOf('1'));//5
console.log(str.charAt(3));//a
var c = str.charAt(10);
console.log(c == '');//true
console.log(str.charCodeAt(3));//97
console.log(str.charCodeAt(10));//NaN
console.log(str.search('a'));//3
</script>
<script>
var str = new String('012a210');
console.log(str.slice(1,3));//12
console.log(str);//'012a210'
console.log(str.substr(1,3));//12a
console.log(str);//'012a210'
console.log(str.substring(1,3));
console.log(str);
</script>