Substring

The Substring function is an alias of Mid.
Returns a substring defined by offset and length.

Usage

Substring(string, start, \[length\])

string (required) The string to extract a substring from.

start (required) The index of the first letter of the extracted substring. The first character of the given string is treated as having index 1.

length (optional) The length of the segment to extract. If length is not given, or if the provided length is longer than the remaining source string, the total remaining string will be returned.

Example

Substring(β€œJohn Doe”, 4, 10)

  • Returns β€œn Doe”

Substring(β€œJohn Doe”, 2, 2)

  • Returns β€œoh”

Substring(β€œMia”, 4)

  • Returns β€œβ€, an empty string.

Related resources