Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Containers > API/Runtime/Core/Containers/StringCast
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Containers/StringConv.h |
| Include | #include "Containers/StringConv.h" |
template<typename To, int32 DefaultConversionSize, typename From>
auto StringCast
(
const From * Str
)
Remarks
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.
Parameters
| Name | Description |
|---|---|
| Str | The null-terminated source string to convert. |