UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TStringFormatter< CharType > Class Template Reference

#include <StringFormatter.h>

Public Member Functions

CORE_API TStringFormatter ()
 
TString< CharType > Format (const CharType *InExpression, const TMap< TString< CharType >, FStringFormatArg > &InArgs) const
 
TString< CharType > Format (const CharType *InExpression, const TArray< FStringFormatArg > &InArgs) const
 
TValueOrError< TString< CharType >, FExpressionErrorFormatStrict (const CharType *InExpression, const TMap< TString< CharType >, FStringFormatArg > &InArgs) const
 
TValueOrError< TString< CharType >, FExpressionErrorFormatStrict (const CharType *InExpression, const TArray< FStringFormatArg > &InArgs) const
 

Detailed Description

template<typename CharType>
class TStringFormatter< CharType >

A string formatter is responsible for formatting string patterns using a set of named, or ordered arguments

Constructor & Destructor Documentation

◆ TStringFormatter()

template<typename CharType >
TStringFormatter< CharType >::TStringFormatter ( )

Member Function Documentation

◆ Format() [1/2]

template<typename CharType >
TString< CharType > TStringFormatter< CharType >::Format ( const CharType *  InExpression,
const TArray< FStringFormatArg > &  InArgs 
) const
inline

Format the specified string using the specified arguments. Replaces instances of {0} with indices from the given array matching the index specified in the token

Parameters
InExpressionA string representing the format expression
InArgsAn array of ordered arguments that match the tokens specified in InExpression
Returns
A string containing the formatted text

◆ Format() [2/2]

template<typename CharType >
TString< CharType > TStringFormatter< CharType >::Format ( const CharType *  InExpression,
const TMap< TString< CharType >, FStringFormatArg > &  InArgs 
) const
inline

Format the specified string using the specified arguments. Replaces instances of { Argument } with keys in the map matching 'Argument'

Parameters
InExpressionA string representing the format expression
InArgsA map of named arguments that match the tokens specified in InExpression
Returns
A string containing the formatted text

◆ FormatStrict() [1/2]

template<typename CharType >
TValueOrError< TString< CharType >, FExpressionError > TStringFormatter< CharType >::FormatStrict ( const CharType *  InExpression,
const TArray< FStringFormatArg > &  InArgs 
) const
inline

Format the specified string using the specified arguments. Replaces instances of {0} with indices from the given array matching the index specified in the token

Parameters
InExpressionA string representing the format expression
InArgsAn array of ordered arguments that match the tokens specified in InExpression
Returns
A string containing the formatted text, or an error where InExpression is ill-formed, or contains undefined arguments

◆ FormatStrict() [2/2]

template<typename CharType >
TValueOrError< TString< CharType >, FExpressionError > TStringFormatter< CharType >::FormatStrict ( const CharType *  InExpression,
const TMap< TString< CharType >, FStringFormatArg > &  InArgs 
) const
inline

Format the specified string using the specified arguments. Replaces instances of { Argument } with keys in the map matching 'Argument'

Parameters
InExpressionA string representing the format expression
InArgsA map of named arguments that match the tokens specified in InExpression
Returns
A string containing the formatted text, or an error where InExpression is ill-formed, or contains undefined arguments

The documentation for this class was generated from the following files: