Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "core"

Index

Functions

replace

  • replace(str: string, toReplace: ReadonlyArray<string> | string, replacer: string): string
  • Replace all the string pass in parameters with the string of replacement with escaping the regex symbol

    example

    replace("« Hello world ! »", " ", &nbsp;); // «&nbsp;Hello&nbsp;world&nbsp;!&nbsp;»

    example

    replace(&nbsp;Hello&nbsp;world&nbsp;!&nbsp;», [ &nbsp;, "!"], " ",); // « Hello world »

    Parameters

    • str: string

      string on which to work

    • toReplace: ReadonlyArray<string> | string

      string to replace

    • replacer: string

      string of replacement

    Returns string

replaceAfter

  • replaceAfter(str: string, toReplace: string, replacer: string, after: ReadonlyArray<string> | string): string
  • Replace the toReplace for the after of the settings

    example

    replaceAfter("« Hello world ! »", " ", &nbsp;, "«"); // «&nbsp;Hello world ! »

    example

    replaceAfter("« Hello world ! »", " ", &nbsp;,[ "«", "!"]); // «&nbsp;Hello world !&nbsp;»

    Parameters

    • str: string

      string on which to work

    • toReplace: string

      string to replace

    • replacer: string

      string of replacement

    • after: ReadonlyArray<string> | string

      after the string in this array

    Returns string

    • String with all occurence after after's string replaced

replaceAround

  • replaceAround(str: string, toReplace: string, replacer: string, around: ReadonlyArray<string> | string): string
  • Replace the toReplace for the around of the settings

    example

    replaceAround("« Hello world ! »", " ", &nbsp;, "«"); // «&nbsp;Hello world ! »

    example

    replaceAround("« Hello world ! »", " ", &nbsp;,[ "«", "!", "»"]); // «&nbsp;Hello world&nbsp;!&nbsp;»

    Parameters

    • str: string

      string on which to work

    • toReplace: string

      string to replace

    • replacer: string

      string of replacement

    • around: ReadonlyArray<string> | string

      around the string in this array

    Returns string

    • String with all occurence after around's string replaced

replaceBefore

  • replaceBefore(str: string, toReplace: string, replacer: string, before: ReadonlyArray<string> | string): string
  • Replace the toReplace for the before of the settings

    example

    replaceBefore("« Hello world ! »", " ", &nbsp;, "»"); // « Hello world !&nbsp;»

    example

    replaceBefore("« Hello world ! »", " ", &nbsp;,[ "»", "!"]); // « Hello world&nbsp;!&nbsp;»

    Parameters

    • str: string

      string on which to work

    • toReplace: string

      string to replace

    • replacer: string

      string of replacement

    • before: ReadonlyArray<string> | string

      before the string in this array

    Returns string

    • String with all occurence before before's string replaced

replaceOnRegex

  • replaceOnRegex(str: string, regex: ReadonlyArray<RegExp> | RegExp, replacer: string): string
  • Replace all selected text by the regexp, replace selected text in the order of declared regexp

    example

    replaceOnRegex("« Hello world ! »", /t/g, !!!); // « Hello world !!! »

    Parameters

    • str: string

      string on which to work

    • regex: ReadonlyArray<RegExp> | RegExp

      regexp for select text

    • replacer: string

      string of replacement

    Returns string

    Return a string with occurence replaced

Generated using TypeDoc