3

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.

manokar
  • 87
  • 1
  • 2
  • 9
  • possible duplicate of [easy-way-to-remove-extension-from-a-filename](http://stackoverflow.com/questions/6417817/easy-way-to-remove-extension-from-a-filename) – Benjy Kessler Apr 22 '15 at 14:34
  • 2
    I would not close it as a duplicate since it has an Unreal Engine specific solution. See the answer. –  Apr 22 '15 at 14:37
  • possible duplicate of [How to get file extension from string in C++](http://stackoverflow.com/questions/51949/how-to-get-file-extension-from-string-in-c) – m0nhawk Apr 22 '15 at 19:17

1 Answers1

2

You can use FPaths::Split to do that:

FPaths::Split(fileName,path,fileNameWithoutExtension,extension);
463035818_is_not_an_ai
  • 109,796
  • 11
  • 89
  • 185