Random Access Memo – javascript – Special Characters for String object

記事を読む

Random Access Memo for Javascript by manomedia

Special Characters for String object

Use \”,\’,\?,\\ for displaying ,,?,\

alert("\\Regular \'expression\' is \"Easy\"\?");


Use \n for starting a new line

alert("Regular\nexpression\nis\nEasy");


Use \t for tab

alert("Regular\texpression\tis\tEasy");


Use \f for form feed – フォーム フィード

alert("Regular\fexpression\fis\fEasy");

Not sure what this does…

Use \r for carriage return – キャリッジリターン

alert("Regular\rexpression\ris\rEasy");

Not sure what this does…

Use \b for backspace – バックスペース

alert("Regular\bexpression\bis\bEasy");

Not sure what this does…

Properties:

String Properties and Methods

  • length
  • prototype
  • constructor

Methods:

  • charAt()
  • charCodeAt()
  • concat()
  • fromCharCode()
  • indexOf()
  • lastIndexOf()
  • match()
  • replace()
  • search()
  • slice()
  • split()
  • substr()
  • substring()
  • toLowerCase()
  • toUpperCase()
  • valueOf()

Citation
http://www.w3schools.com/js/js_obj_string.asp