Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » String » Substring

Substring


This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.

Header: STD.h
Namespace: avl
Module: FoundationLite

Creates a string from a fragment of the input string.

Syntax

void avl::Substring
(
	const atl::String& inString,
	const int inStart,
	const atl::Optional<int>& inLength,
	atl::String& outSubstring
)

Parameters

Name Type Range Default Description
Input value inString const String&
Input value inStart const int 0 -
Input value inLength const Optional<int>& 0 - NIL
Output value outSubstring String&

Examples

When inString input parameter is:

Test string

and mandatory input parameter inStart equals 5, filter will give as a result outSubstring:

string

since the indexing of the string is zero-based and string starts at 5-th index of Test string. Notice that whitespace is not included into result, because its index is 4.

Naturally, it is also possible to manipulate length of outSubstring. For considered example, in case when optional input parameter inLength is in use and its value equals 3 an output outSubstring of the filter will be:

str