如何在虚幻引擎中获取没有扩展名的文件名?

How to get Filename without extension in Unreal?

我一直在使用下面的代码来获取文件名,它对我来说工作正常。但是我的文件名没有扩展名(.uasset)。

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

在此先感谢您的帮助。

您可以使用 FPaths::Split 来做到这一点:

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