Files
XCEngine/docs/api/resources/resourcepath/getstem.md

763 B
Raw Blame History

ResourcePath::GetStem

Containers::String GetStem() const

获取文件名(不含扩展名)。

详细描述:

返回路径中文件名部分,不包含扩展名。兼容 Windows (\) 和 Unix (/) 路径分隔符。

返回: Containers::String,文件名(不含扩展名)

复杂度: O(n)n 为路径长度

示例:

ResourcePath path("textures/player.png");
Containers::String stem = path.GetStem();  // "player"

ResourcePath path2("textures/player.backup.png");
Containers::String stem2 = path2.GetStem();  // "player.backup"

ResourcePath path3("textures");
Containers::String stem3 = path3.GetStem();  // "textures"

相关文档