Liam0205 / liam0205.github.io

Deployment of my weblog.
https://liam0205.github.io
35 stars 5 forks source link

C++ 标准库中缺少的字符串函数:`starts_with` 和 `ends_with` | 始终 #211

Open Liam0205 opened 5 years ago

Liam0205 commented 5 years ago

https://liam.page/2017/12/14/the-missing-starts-with-and-ends-with-in-Cpp-for-std-string/

这是一篇简短的记录。 C++ 标准模板库的 std::string 很好很强大,但是并没有提供判断一个字符串是否以另一个字符串开始/结束的接口。这里为 std::basic_string<charT> 提供这两个接口。