Search code examples
c++unreal-engine4

How to get Filename without extension in Unreal?


I've been using the below code to get the filename and it's works fine for me. But I the file name WITHOUT extension(.uasset).

const FString fileName = FPaths::GetCleanFilename(filePath);

Thanks in advance for your help.


Solution

  • You can use FPaths::Split to do that:

    FPaths::Split(fileName,path,fileNameWithoutExtension,extension);