博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
string
阅读量:4596 次
发布时间:2019-06-09

本文共 848 字,大约阅读时间需要 2 分钟。

#include <iostream>

#include <string>
using namespace std;

int main()

{
string str;
while(cin>>str)
{
//char c = str.at(1);
//cout<<c;//input abc, return b

//cout<<str.capacity()<<endl;//return str's size,but must be 4n;

//str.clear();
//cout<<str;
//cout<<str.compare("abc");//same as strcmp()
//cout<<str.find_first_of('o');//find first pos of 'o'
//cout<<str.append("abc");//add "abc" after str
//cout<<*str.begin();//same as begin() in vector,so is end()
//int flag = str.find("ab");//return the pos of "ab" in str,-1 will return if not find
//cout<<str.length()<<endl;//return str's length,example:"abc"->3

//str.erase(str.begin());//remove the char which is pointed by iterator

//cout<<str.find_last_of('o')<<endl;//find last pos of char
//str.push_back('a');//pushback one char

}

return 0;

}

转载于:https://www.cnblogs.com/55open/p/4111562.html

你可能感兴趣的文章
zabbix 监控jmx 需要--enable-java
查看>>
pl/sql 在一个程序块里打印日志输出到表格
查看>>
Python目录操作
查看>>
静态内部类实现 单例模式
查看>>
基于Matlab的FIR滤波器设计与实现
查看>>
Spring Security 与 OAuth2 介绍
查看>>
程序不分难易高低
查看>>
1481:Maximum sum
查看>>
codeforces 990C Bracket Sequences Concatenation Problem
查看>>
上传图片时,CMKY转RGB
查看>>
【POJ 2777】 Count Color(线段树区间更新与查询)
查看>>
Storm项目:流数据监控1《设计文档…
查看>>
南阳oj 语言入门 A+B paoblem 题目477 题目844
查看>>
ffmpeg 内存池
查看>>
双语小说阅读:《谁动了我的奶酪》
查看>>
linux touch和vi建立的文件是什么文件类型的
查看>>
3-9
查看>>
导航右侧添加按钮、隐藏导航条和状态栏
查看>>
第二阶段冲刺6
查看>>
Java中final关键字的用法
查看>>