Answer

问题及解答

U++ 中涉及字符串的函数

Posted by haifeng on 2021-06-17 22:51:22 last update 2021-06-17 22:52:26 | Edit | Answers (0)

tmpstr 存储了文件名, 现在检查其是否以 ".mp3" 结尾, 可以使用 EndsWith() 函数

if(tmpstr.Find(strToFind)+4==tmpstr.GetLength())
if(tmpstr.EndsWith(".mp3"))

与之对应, 检查tmpstr是否以某字符串作为开头, 可以使用 StartWith()函数.

GetLength() 与 GetCount() 是同义的, 计算其中含有字符的个数.  类似于 std::string 中的 size() 或 length() 函数.

 


References:

U++ Core Tutorial :: Ultimate++ (ultimatepp.org)