TCString

Set of basic string utility functions operating on plain C strings.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/CString.h

Include

#include "Misc/CString.h"

Syntax

template<typename T>
struct TCString

Remarks

Set of basic string utility functions operating on plain C strings. In addition to the wrapped C string API,this struct also contains a set of widely used utility functions that operate on c strings. There is a specialized implementation for ANSICHAR and WIDECHAR strings provided. To access these functionality, the convenience typedefs FCString and FCStringAnsi are provided.

Functions

Name Description

Public function Static

double

 

Atod

(
    const CharType* String
)

Atod wrapper

Public function Static

float

 

Atof

(
    const CharType* String
)

Atof wrapper

Public function Static

int32

 

Atoi

(
    const CharType* String
)

Atoi wrapper

Public function Static

int64

 

Atoi64

(
    const CharType* String
)

Atoi64 wrapper

Public function Static

int32

 

GetVarArgs

(
    CharType* Dest,
    SIZE_T DestSize,
    const CharType*& Fmt,
    va_list ArgPtr
)

Helper function to write formatted output using an argument list

Public function Static

bool

 

IsNumeric

(
    const CharType* Str
)

Returns whether this string contains only numeric characters

Public function

bool

 

IsPureAnsi

(
    const CharType* Str
)

Public function

bool

 

IsPureAnsi

(
    const CharType* Str,
    const SIZE_T StrLen
)

Public function

bool

 

IsPureAnsi

(
    const CharType* Str,
    const SIZE_T StrLen
)

Public function Static

bool

 

IsPureAnsi

(
    const CharType* Str,
    const SIZE_T StrLen
)

Returns whether this string contains only pure ansi characters

Public function

bool

 

IsPureAnsi

(
    const CharType* Str
)

Public function Static

bool

 

IsPureAnsi

(
    const CharType* Str
)

Returns whether this string contains only pure ansi characters

Public function Static

int32

 

Snprintf

(
    CharType* Dest,
    int32 DestSize,
    const FmtType& Fmt,
    Types... Args
)

Safe string formatted print.

Public function Static

const CharTy...

 

Spc

(
    int32 NumSpaces
)

Returns a static string that is filled with a variable number of spaces

Public function Static

int32

 

Sprintf

(
    CharType* Dest,
    const FmtType& Fmt,
    Types... Args
)

Standard string formatted print.

Public function Static

CharType ...

 

Strcat

(
    CharType* Dest,
    SIZE_T DestCount,
    const CharType* Src
)

Strcat wrapper

Public function Static

CharType ...

 

Strcat

(
    CharType Dest,
    const CharType* Src
)

Strcat wrapper (templated version to automatically handle static destination array case)

Public function Static

CharType ...

 

Strchr

(
    CharType* String,
    CharType c
)

Strchr wrapper

Public function Static

const CharTy...

 

Strchr

(
    const CharType* String,
    CharType c
)

Strchr wrapper

Public function Static

int32

 

Strcmp

(
    const CharType* String1,
    const CharType* String2
)

Strcmp wrapper

Public function Static

CharType ...

 

Strcpy

(
    CharType* Dest,
    SIZE_T DestCount,
    const CharType* Src
)

Strcpy wrapper

Public function Static

CharType ...

 

Strcpy

(
    CharType Dest,
    const CharType* Src
)

Strcpy wrapper (templated version to automatically handle static destination array case)

Public function Static

int32

 

Strcspn

(
    const CharType* String,
    const CharType* Mask
)

Strcspn wrapper

Public function Static

const CharTy...

 

Strfind

(
    const CharType* Str,
    const CharType* Find,
    bool bSkipQuotedChars
)

Find string in string, case sensitive, requires non-alphanumeric lead-in.

Public function Static

const CharTy...

 

StrfindDelim

(
    const CharType* Str,
    const CharType* Find,
    const CharType* Delim
)

Finds string in string, case insensitive, requires the string be surrounded by one the specified delimiters, or the start or end of the string.

Public function Static

int32

 

Stricmp

(
    const CharType* String1,
    const CharType* String2
)

Stricmp wrapper

Public function Static

const CharTy...

 

Strifind

(
    const CharType* Str,
    const CharType* Find,
    bool bSkipQuotedChars
)

Find string in string, case insensitive, requires non-alphanumeric lead-in.

Public function Static

CharType ...

 

Stristr

(
    CharType* Str,
    const CharType* Find
)

Finds string in string, case insensitive (non-const version)

Public function Static

const CharTy...

 

Stristr

(
    const CharType* Str,
    const CharType* Find
)

Finds string in string, case insensitive

Public function Static

int32

 

Strlen

(
    const CharType* String
)

Strlen wrapper

Public function Static

CharType ...

 

Strncat

(
    CharType* Dest,
    const CharType* Src,
    int32 MaxLen
)

Concatenate a string with length checking.

Public function Static

int32

 

Strncmp

(
    const CharType* String1,
    const CharType* String2,
    SIZE_T Count
)

Strncmp wrapper

Public function Static

CharType ...

 

Strncpy

(
    CharType* Dest,
    const CharType* Src,
    int32 MaxLen
)

Copy a string with length checking. Behavior differs from strncpy in that last character is zeroed.

Public function Static

int32

 

Strnicmp

(
    const CharType* String1,
    const CharType* String2,
    SIZE_T Count
)

Strnicmp wrapper

Public function Static

int32

 

Strnlen

(
    const CharType* String,
    SIZE_T StringSize
)

Calculate the length of the string up to the given size.

Public function Static

CharType ...

 

Strrchr

(
    CharType* String,
    CharType c
)

Strrchr wrapper

Public function Static

const CharTy...

 

Strrchr

(
    const CharType* String,
    CharType c
)

Strrchr wrapper

Public function Static

const CharTy...

 

Strrstr

(
    const CharType* String,
    const CharType* Find
)

Strrstr wrapper

Public function Static

CharType ...

 

Strrstr

(
    CharType* String,
    const CharType* Find
)

Strrstr wrapper

Public function Static

int32

 

Strspn

(
    const CharType* String,
    const CharType* Mask
)

Strspn wrapper

Public function Static

CharType ...

 

Strstr

(
    CharType* String,
    const CharType* Find
)

Strstr wrapper

Public function Static

const CharTy...

 

Strstr

(
    const CharType* String,
    const CharType* Find
)

Strstr wrapper

Public function Static

int32

 

Strtoi

(
    const CharType* Start,
    CharType** End,
    int32 Base
)

Strtoi wrapper

Public function Static

int64

 

Strtoi64

(
    const CharType* Start,
    CharType** End,
    int32 Base
)

Strtoi wrapper

Public function Static

CharType ...

 

Strtok

(
    CharType* TokenString,
    const CharType* Delim,
    CharType** Context
)

Strtok wrapper

Public function Static

uint64

 

Strtoui64

(
    const CharType* Start,
    CharType** End,
    int32 Base
)

Strtoui wrapper

Public function Static

CharType ...

 

Strupr

(
    CharType* Dest,
    SIZE_T DestCount
)

Strupr wrapper

Public function Static

CharType ...

 

Strupr

(
    CharType Dest
)

Strupr wrapper (templated version to automatically handle static destination array case)

Public function Static

const CharTy...

 

Tab

(
    int32 NumTabs
)

Returns a static string that is filled with a variable number of tabs

Public function Static

bool

 

ToBool

(
    const CharType* String
)

Converts a string into a boolean value 1, "True", "Yes", [FCoreTexts::True](API\Runtime\Core\FCoreTexts\True), [FCoreTexts::Yes](API\Runtime\Core\FCoreTexts\Yes), and non-zero integers become true 0, "False", "No", [FCoreTexts::False](API\Runtime\Core\FCoreTexts\False), [FCoreTexts::No](API\Runtime\Core\FCoreTexts\No), and unparsable values become false

Public function

bool

 

ToBool

(
    const WIDECHAR* Str
)

Public function

bool

 

ToBool

(
    const ANSICHAR* Str
)

Typedefs

Name

Description

CharType

Deprecated Functions

Name Description

Public function Static

int32

 

GetVarArgs

(
    CharType* Dest,
    SIZE_T DestSize,
    int32 Count,
    const CharType*& Fmt,
    va_list ArgPtr
)

GetVarArgs with DestSize and Count arguments has been deprecated - only DestSize should be passed

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss