string字符串
来源:互联网 发布:网络推广工资待遇 编辑:程序博客网 时间:2024/05/19 16:50
1626-5-刘小铭总结《2016年10月15日》【连续15天总结】
标题:string字符串
关键词:string语句
内容:
A、一句话概括今日目标完成情况
string语句学习:50%
B、具体内容:
今天去打枪,打完没什么感觉,但是还是想再打几发,感觉特别兴奋。今天学的不多,string字符串还是第一次见。其中find什么的还是头一次。
#include<iostream>
#include<string>
using namespace std;//包含头文件string
int main()
{
string text1("Heavy rains are pushing water levels beyond the limit.");//定义并初始化text1
string text2,text3;
int k;
text2="Sluice gates at Three Gorges Dam opened to discharge water.";
text3=text1+text2;
k=text3.find("Heavy");//这个用法没用过
text3.erase(k,sizeof("Heavy")-1);//因为Heavy实际是用6个字符
text3.insert(k,"Strong");//没用过,之前的知识没有涉及
cout<<text3;
return 0;
}
使用string字符串,要在开始包含头文件中#include<string>,删除的时候要注意所删字符实际占用多少。但是今天只是初步了解其用法,明天上网搜搜有没其他与之相关的例题,自己做做,更加熟悉它的用法。
C、明日计划:找例题,自己做题,熟悉string字符串用法。
- 字符串string
- string字符串
- String字符串
- String字符串
- String字符串
- 字符串String
- 字符串String
- 字符串String
- String 字符串
- 字符串String
- String字符串
- 字符串string
- String字符串
- string字符串
- String字符串
- 字符串 String
- 字符串(String)
- String字符串
- Android练习-----普通按钮(Button) && 图片按钮(ImageButton)
- 有三个箱子,有一个中奖,你选定了一个箱子,主持人打开一个没有奖的箱子,问你换不换,是换概率大还是不换概率大
- css3 小图标运用 1.图片合成 2.font+html @font-face 3.font+css
- 蛇形填数
- 【NDN基础】Named Data Networking 学习笔记
- string字符串
- 51nod-1009-数位dp
- java基础--方法
- .NET RSACryptoServiceProvider【创建公共/私有密钥对】
- java中 List 与Set 的区别
- EventBusException: Subscriber class *** and its super classes have no public methods with the @Subsc
- 且或非异或
- iOS毛玻璃效果
- 比较运算符