RealDocs

UAssetManager::GetNormalizedPackagePath

function Engine Since 4.22
#include "Engine/AssetManager.h"
Access: public Specifiers: static

Description

Returns a normalized copy of a package path, removing duplicate slashes and adding or stripping a final trailing slash as requested. Non-mutating counterpart to NormalizePackagePath.

Caveats & Gotchas

  • Prefer this over NormalizePackagePath in expressions or const contexts since it doesn't require a mutable FString to modify in place.

Signature

static FString GetNormalizedPackagePath(const FString& InPath, bool bIncludeFinalSlash)

Parameters

Name Type Description Default
InPath const FString& Path to normalize.
bIncludeFinalSlash bool If true, ensures a trailing slash is present; if false, ensures it's removed.

Return Type

FString

Example

Get a normalized path without a trailing slash C++
FString Normalized = UAssetManager::GetNormalizedPackagePath(TEXT("/Game//Items/"), false);
// Normalized == TEXT("/Game/Items")

Version History

Introduced in: 4.22

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.