Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Strings

Class who contains all algorithms about Text and String.

author

Nicolas GILLE nic.gille@gmail.com

since

0.3.0

version

1.0

license

MIT

Hierarchy

  • Strings

Index

Constructors

Properties

Methods

Constructors

constructor

  • Constructor of the Strings object.

    since

    0.3.0

    version

    1.0

    Returns Strings

Properties

Static PUNCTUATION_REGEX

PUNCTUATION_REGEX: RegExp = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~]/g

Get all punctuations from a string.

static
since

0.3.0

version

1.0

Static SPACE_REGEX

SPACE_REGEX: RegExp = /\s+/g

Get all spaces from a string.

static
since

0.3.0

version

1.0

Methods

palindrome

  • palindrome(text: string, isCaseSensitive?: boolean): boolean
  • Check if the text is a palindrome.

    since

    0.3.0

    version

    1.0

    Parameters

    • text: string

      The text.

    • Default value isCaseSensitive: boolean = false

      Specify if the palindrome is concerned by the case sensitivity or not. By default, the palindrome don't check the case sensitive.

    Returns boolean

    A boolean to indicate if the text is a palindrome or not.

reverse

  • reverse(text: string): string
  • Reverse the order of a text. For example, the following text reversed became : "Where is Bryan ?" became "? nayrB si erehW"

    since

    0.3.0

    version

    1.0

    Parameters

    • text: string

      The initial text to reverse order of all characters.

    Returns string

    The text with all characters inverted.

Generated using TypeDoc