RealDocs

UKismetSystemLibrary::NormalizeFilename

function Engine Blueprint Since 4.0
#include "Kismet/KismetSystemLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPureBlueprintThreadSafe

Description

Converts all forward and backward slashes in a path to a single consistent forward-slash form, useful before comparing or hashing paths.

Caveats & Gotchas

  • Purely a string transform — it does not resolve `..`/`.` segments, make the path absolute, or verify the path exists.
  • Marked BlueprintThreadSafe, so it's safe to call off the game thread.
  • Useful as a pre-step before string-comparing two paths that may have come from different OSes (Windows backslashes vs. Unix forward slashes).

Signature

static FString NormalizeFilename(const FString& InFilename)

Parameters

Name Type Description Default
InFilename const FString& The filename/path to normalize.

Return Type

FString

Example

Normalize a path before comparing it to another C++
FString NormalizedA = UKismetSystemLibrary::NormalizeFilename(PathA);
FString NormalizedB = UKismetSystemLibrary::NormalizeFilename(PathB);
bool bSame = NormalizedA.Equals(NormalizedB, ESearchCase::IgnoreCase);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.