Skip to content

substring ​

Gets a substring of a string.

Type: transform

Parameters ​

  • input (unknown): The input string.
  • start (number): The starting index of the substring.
  • length (number): The length of the substring.

Returns ​

Type: string

The substring of the input string.

Examples ​

javascript
substring("hello world", 0, 5) // "hello"

Released under the MIT License.