Reference address: http://ulhoo.com/blog? P = 285
Http://www.cnblogs.com/wangkangluo1/archive/2011/07/17/2108819.html
Http://topic.csdn.net/u/20090104/23/4ddb686c-93aa-4189-9ded-9f0b7af61ed0.html
ReferenceCode:
1
< Script Type = " Text/JavaScript " >
VaR Fendata = " 9, 45 | 4, 12 | 9, 21 | " ;
VaR PID = ' 9 ' ;
VaR rstr = new Regexp (PID + ", \ D {1, 2 }\|", "G" );
Alert (rstr );
Alert (fendata. Replace (rstr, '' ));
Alert (fendata );
< / SCRIPT>
2
/*
* Unicode encoding and conversion of Characters
*/
" Yes " . Charcodeat () = 35201 ; // True, 35201 is a decimal Value
String. fromcharcode (35201) = "yes"; // true, 35201 is a 10-digit Value
" \ U89 " + " 81 " = " Yes " ; // False, the value is "u8981", because "\ U" is converted to "U"
// Unicode encoding to character
Eval ( " (\ "\ U89 " + " 81 \") " ) = " Yes " ; // True, 8981 is a hexadecimal value
Conclusion:
VaRINS=String. fromcharcode (160);
INS= NewRegexp (INS,"G");
S=S. Replace (INS,"");
End