skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : Substring
 

Try Corticon Now

Substring

SYNTAX

<String>.substring( <Integer1>, <Integer2>)

DESCRIPTION

Returns the portion of <String> beginning with the character in position <Integer1> and ending with the character in position <Integer2>. The number of characters in <String> must be at least equal to <Integer2>, otherwise an error will be produced. Both <Integer1> and <Integer2> must be positive integers, and <Integer2> must be greater than <Integer1>.

USAGE RESTRICTIONS

The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.

RULESHEET EXAMPLE

This sample Rulesheet uses .substring to return those characters of string1 between positions 4 and 7 (inclusive), and assign the resulting value to string2.

SAMPLE RULETEST

A sample Ruletest provides string1 values for four examples. Input and Output panels are shown below.