SubString

The SubStringfunction extracts a string of specified length from a longer string in which it occurs.

Syntax

  Copy codeCopy code
string SubString(
  string searchString,
  int startingIndex,
  int length
);

Parameters

searchString

The string to be searched.

startingIndex

The place in searchStringwhere the string to be extracted begins.

Length

The number of characters in the string to be extracted. Optional.

Return values

Returns the specified string if present in searchString. If the specified string is not present, returns null .

The length argument is optional. If no value is passed, the function returns the string from startingIndexto the end of searchString.