RealDocs

UBlueprintPathsLibrary::GetCleanFilename

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

Description

Returns the filename, including its extension, with any directory path information removed.

Caveats & Gotchas

  • Does not verify the file exists on disk — this is pure string manipulation on the path.
  • If InPath has no path separators the input is returned unchanged.

Signature

static FString GetCleanFilename(const FString& InPath)

Parameters

Name Type Description Default
InPath const FString& The full path to strip.

Return Type

FString

Example

Strip the directory from a path C++
FString Clean = UBlueprintPathsLibrary::GetCleanFilename(TEXT("Content/Textures/Rock.png"));
// Clean == TEXT("Rock.png")

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.