Carrot reference
Functions

subString()

Given a String and specified parameters, returns a part of that String.

Syntax

subString(string, start[, length])

  • string - the String value from which to derive the returned String
  • start - the starting index of the returned String
  • length - (optional) the length of the returned String
  • Return type: String

Sample usage

subString("Piece of cake.", 2) returns "ece of cake."

subString("Piece of cake.", 2, 3) returns "ece"

Supported data types

Input type

Return type

Logic

String

String

If a String value is passed, that value will be interpreted beginning with the start index. If a length is provided, the returned String will contain that many characters, beginning with the index. If not, the returned String will contain all remaining characters beginning with the index.

Unsupported data types

Null

Unsupported data types return Null.



Updated 04 Oct 2023
Doc contributor
Did this page help you?