Navigation
API > API/Runtime > API/Runtime/Core
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
auto StringCast
(
const From* Str |
StringCast example usage: | Containers/StringConv.h | |
auto StringCast
(
const From* Str, |
Creates an object which acts as a source of a given string type. | Containers/StringConv.h |
StringCast(const From *)
Description
StringCast example usage:
void Func(const FString& Str, const TCHAR* MediumLong, FStringView MediumLongSV) { // Basic version auto Src = StringCast
StringCast expects correctly-typed strings. If a cast is attempted with a char* or ANSICHAR*, and the string contains characters that are non-ASCII, including UTF-8 code units outside of the 7-bit ASCII range, then those values will fail to convert and a bogus char will be written in their place.
If a conversion from UTF-8 is desired, the pointer should be cast to UTF8CHAR* before being passed to StringCast.
Similarly, doing a StringCast
The source string must not be modified or destroyed until after the result of this function has been destroyed.
| Name | StringCast |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/StringConv.h |
| Include Path | #include "Containers/StringConv.h" |
template<typename To, int32 DefaultConversionSize, typename From>
auto StringCast
(
const From * Str
)
Parameters
| Name | Remarks |
|---|---|
| Str | The null-terminated source string to convert. |
StringCast(const From *, int32)
Description
Creates an object which acts as a source of a given string type. See example above.
StringCast expects correctly-typed strings. If a cast is attempted with a char* or ANSICHAR*, and the string contains characters that are non-ASCII, including UTF-8 code units outside of the 7-bit ASCII range, then those values will fail to convert and a bogus char will be written in their place.
If a conversion from UTF-8 is desired, the pointer should be cast to UTF8CHAR* before being passed to StringCast.
Similarly, doing a StringCast
The source string must not be modified or destroyed until after the result of this function has been destroyed.
| Name | StringCast |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/StringConv.h |
| Include Path | #include "Containers/StringConv.h" |
template<typename To, int32 DefaultConversionSize, typename From>
auto StringCast
(
const From * Str,
int32 Len
)
Parameters
| Name | Remarks |
|---|---|
| Str | The source string to convert, not necessarily null-terminated. |
| Len | The number of From elements in Str. |