Back to Aurora Vision Library website

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

FormatString


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 according to the given format and data.

Syntax

void avl::FormatString
(
	const atl::String& inFormat,
	const atl::Array<atl::String>& inData,
	atl::String& outFormattedString
)

Parameters

Name Type Default Description
Input value inFormat const String& Format string
Input value inData const Array<String>& Values used in format
Output value outFormattedString String& Output formatted string

Description

The filter creates a string from inFormat pattern.

Using data in the pattern

It is possible to use values from inData array in the pattern. To do it, expression %VAL% must be inserted, where VAL it is an index of a value in an array.

Escape sequences

Table shown below presents list of escape sequences, which can be used in a inFormat string.

Escape sequence Represents
\aBell
\bBackspace
\fForm feed
\nNew line
\rCarriage return
\tHorizontal tab
\vVertical tab
\xHHASCII character in hexadecimal notation
\'Single quotation mark
\"Double quotation mark
\?Literal question mark
\0End of string

Examples

inFormat =
This is the %0% line\n\tand this is the %2% line

inData = {"first", "unused", "second"}
outFormattedString =
This is the first line
	and this is the second line