cpp中std::string容器的一些性质

力扣上刷到一条动态规划解决字符串匹配的题目
对cpp的stl容器的std::string的一些性质进行记录
1.字符串可以相加
1 | string word1="hello"; |
2.find()
std::string容器自带find方法可以返回第一个出现的子串的下标
3.std::string::npos
- Title: cpp中std::string容器的一些性质
- Author: gnahz
- Created at : 2025-09-10 13:24:10
- Updated at : 2025-09-10 22:12:07
- Link: https://redefine.ohevan.com/2025/09/10/cpp中std-string容器的一些性质/
- License: This work is licensed under CC BY-NC-SA 4.0.
Comments