字符串String

定义:字符串是一组由16位值组成的不可变的有序序列。

1:转义字符

转义字符
含义
o
u000

退格符

水平制表符

换行符
v
垂直制表符
f
换页符

回车符
\
反斜线
*
单引号

2:使用

 1 var s = "hello" 2 s.length   
 3 s.charAt(0);
 4 s.charAt(s,length-1);
 5 s.substring(1,4);
 6 s.slice(1,4);
 7 s.slice(-3);
 8 s.indexof("3");
 9 s.lastindexof("1");
10 s.index("1",3);
11 s.split(",");
12 s.replace("h","H");
13 s.toUpperCase();


原文地址:https://www.cnblogs.com/QianBoy/p/7586236.html