UKismetStringLibrary::GetCharacterAsNumber
#include "Kismet/KismetStringLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Gets a single character from SourceString at Index and returns its integer character-code value.
Caveats & Gotchas
- • Returns 0 if Index is out of range, which is indistinguishable from the code for a genuine null character.
- • Returns the raw TCHAR code point, not an ASCII-only value, so results for non-ASCII characters depend on the platform's TCHAR encoding (typically UTF-16).
Signature
static int32 GetCharacterAsNumber(const FString& SourceString, int32 Index = 0) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| SourceString | const FString& | The string to read from. | — |
| Index | int32 | Location of the character whose value is required. | 0 |
Return Type
int32 Example
Read the first character's code C++
int32 FirstCharCode = UKismetStringLibrary::GetCharacterAsNumber(InputText, 0); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?