Creating a string

Let STR = ‘XXX’ directly assigns a method to create a normal string,typeof STR === ‘string’. Let STR = new String(‘ XXX ‘) constructor to create a String object, typeof STR === ‘object’.

String method

  • Str.anchor () creates an anchor, which creates an empty A tag.

  • The str.big() string is displayed in large font.
  • Str.blink () displays the blinking string.
  • Str.bold () appears in bold.
  • Str.charat () returns a string at the specified location.

  • Str.charcodeat () returns the Unicode encoding of the string at the specified position.

  • Str.concat () connection string.

  • Str.fixed () Typewriter text display string.
  • Str.fontcolor (‘red’) sets the character color.
  • Str.fontsize (20) Sets the character size.
  • String.fromcharcode (97,98) accepts a specified Unicode value and returns a String.
  • Str.indexof () retrieves a string.
  • Str.lastindexof () retrieving the string from back to front returns exactly the same result as indexOf().
  • Str.link () string links.
  • Str.localcompare () compares strings in a specific order.

  • Str.match () Returns null if the string does not match
  • Str.replace (subStr, newStr) replaces the string, returning a new string without changing the original string.

  • Search () retrieves the string.
  • Slice () intercepts the string.
  • substr()
  • substring()

  • Small () is the opposite of big().
  • The split ().
  • Strike () displays the stripper string.
  • Sub () displays the string as a subscript.
  • Sup () displays the character string as superscript.
  • ToLocaleLowerCase () toLowerCase
  • ToLocaleUpperCase () toUpperCase() uppercase

These are some of the common methods for strings, followed by the new common methods in ES6.