substring( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Extracts a portion of a string expression.

The substring() method configures the aggregation pipeline to extract a portion of the specified string expression.

Method Declaration
Copy
Method Parameters
expressionExpression

Expression to extract a substring from. Expression must resolve to a string.


startExpression

Starting position of the substring to extract, specified in zero-based indexing. Expression must resolve to a number.


lengthExpression

Number of characters to extract from the starting position. Expression must resolve to a number.

Returns
Return Type:SubstringExpression
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?