RealDocs

UBlueprintPathsLibrary::IsSamePath

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

Description

Checks whether two paths refer to the same location, accounting for slash direction and trailing separator differences.

Caveats & Gotchas

  • This is not a simple string equality check — it normalizes both paths internally first, so "Content/Textures" and "Content\\Textures/" compare equal.
  • Do not use this in place of an actual filesystem existence/identity check (e.g. resolving symlinks); it only compares the textual path representation.

Signature

static bool IsSamePath(const FString& PathA, const FString& PathB)

Parameters

Name Type Description Default
PathA const FString& First path to compare.
PathB const FString& Second path to compare.

Return Type

bool

Example

Compare two differently-formatted paths C++
bool bSame = UBlueprintPathsLibrary::IsSamePath(TEXT("Content/Textures"), TEXT("Content\\Textures/"));
// bSame == true

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.