UKismetStringLibrary::Conv_StringToName
#include "Kismet/KismetStringLibrary.h"
Access: public
Specifiers: staticBlueprintPureBlueprintAutocast
Description
Converts a string to an FName. Use this when you need to pass string data into an API or comparison that expects a name, such as tag matching or asset lookups.
Caveats & Gotchas
- • Every distinct string passed in creates a new entry in the global name table if one doesn't already exist, and FNames are never garbage collected — repeatedly converting unbounded or user-generated strings (e.g. player chat text) will leak memory over a long-running session.
- • FName construction and comparison ignore case, so "Enemy" and "ENEMY" produce FNames that compare equal even though they came from differently-cased strings.
Signature
static FName Conv_StringToName(const FString& InString) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InString | const FString& | The string to convert to a name. | — |
Return Type
FName Example
Convert a config string to a gameplay tag name C++
FString ConfigValue = TEXT("Enemy");
FName TagName = UKismetStringLibrary::Conv_StringToName(ConfigValue); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?