RealDocs

UBlueprintPathsLibrary::NormalizeDirectoryName

function Engine Blueprint Since 4.20
#include "Kismet/BlueprintPathsLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Normalizes all '/' and '\' to '/' and strips a trailing slash, unless the character before it is itself a slash or a colon.

Caveats & Gotchas

  • The result is returned via the OutPath output parameter, not the return value.
  • Because a trailing slash is only removed when the preceding character isn't a slash or colon, a root like "C:/" is left with its trailing slash intact — this preserves valid drive roots but can surprise callers expecting slash-stripping to be unconditional.

Signature

static void NormalizeDirectoryName(const FString& InPath, FString& OutPath)

Parameters

Name Type Description Default
InPath const FString& The directory path to normalize.
OutPath FString& Receives the normalized directory name.

Return Type

void

Example

Strip a trailing slash from a directory path C++
FString Normalized;
UBlueprintPathsLibrary::NormalizeDirectoryName(TEXT("Content/Textures/"), Normalized);
// Normalized == TEXT("Content/Textures")

Version History

Introduced in: 4.20

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.