c++中操作字符串string常用的api
时间: 2024-06-01 13:10:26 浏览: 181
以下是C语言中常用的字符串操作函数:
1. strlen() - 计算字符串长度
2. strcpy() - 复制一个字符串
3. strncpy() - 复制一个字符串的一部分
4. strcat() - 连接两个字符串
5. strncat() - 连接两个字符串的一部分
6. strcmp() - 比较两个字符串的大小
7. strncmp() - 比较两个字符串的一部分的大小
8. strchr() - 在字符串中查找一个字符
9. strstr() - 在字符串中查找一个子串
10. strtok() - 将字符串分割成一组子字符串
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231044833.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044833.png)
![-](https://img-home.csdnimg.cn/images/20241231044833.png)