JavaScript String.trim(), .
string.trim();
JavaScript String.replace() Regex, :
string.replace(/\s/g,"");
, , . ( , )
string.substring(0,2);
, , 3.
string.substring(0,2).replace(/\S\s/g,"").trim();
( ):
"[D[A[C[D[B[D[A[B[C[Dhhh\u000A"
Regex :
"[D[A[C[D[B[D[A[B[C[Dhhh\u000A".replace(/\[(B|C|D|A)/gm,"");
"hhh" ( ), ...
Object:
Object("[D[A[C[D[B[D[A[B[C[Dhhh\u000A".replace(/\[(B|C|D|A)/gm,""));
( Chrome Dev console ):
String {0: "h", 1: "h", 2: "h", 3: "↵", length: 4, [[PrimitiveValue]]: "hhh↵"}
, , ? , , .
user3117575