You are here: Start » Function Reference » String » 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: | fil |
Creates a string from a fragment of the input string.
Syntax
void fil::Substring ( const ftl::String& inString, const int inStart, const ftl::Optional<int>& inLength, ftl::String& outSubstring )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inString | const String& | |||
![]() |
inStart | const int | 0 - ![]() |
||
![]() |
inLength | const Optional<int>& | 0 - ![]() |
NIL | |
![]() |
outSubstring | String& |
Examples
When inString input parameter is:
and mandatory input parameter inStart equals 5, filter will give as a result outSubstring:
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: