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,
int32 Len
)
Remarks
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.
Parameters
| Name | Description |
|---|---|
| Str | The source string to convert, not necessarily null-terminated. |
| Len | The number of From elements in Str. |