SlugStringForValidName

Given a display label string, generates an [FString](API\Runtime\Core\Containers\FString) slug that only contains valid characters for an [FName](API\Runtime\Core\UObject\FName).

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Containers/UnrealString.h

Include

#include "Containers/UnrealString.h"

Source

/Engine/Source/Runtime/Core/Private/Containers/String.cpp

Syntax

FString SlugStringForValidName
(
    const FString & DisplayString,
    const TCHAR * ReplaceWith
)

Remarks

Given a display label string, generates an FString slug that only contains valid characters for an FName. For example, "[MyObject]: Object Label" becomes "MyObjectObjectLabel" FName slug.

Returns

The slugged string

Parameters

Parameter

Description

DisplayLabel

The label string to convert to an FName