Click or drag to resize
Substring

[This is preliminary documentation and is subject to change.]

The TOPICA Basic function Substring is used to extract a substring from an input string.

Syntax
Substring(inputString, startIndex, length)
Parameters

Name

Type

Description

inputString

String

The string value to extract substring from.

startIndex

Integer

The starting index (in inputString) to extract from. NB: zero-based!

length

Integer

The number of characters to extract.

Returns

Substring containing length characters.

Type: String.

Examples
Substring("abcdefghijkl", 3, 5)

Result: "defgh"

Substring("abcdefghijkl", 10, 2)

Result: "kl"

Substring("abcdefghijkl", 10, 3)

Result: exception (because input string only contains 12 characters)