1. 程式人生 > >記一些stl的用法(持續更新)

記一些stl的用法(持續更新)

spa style str https tps sdf sub name span

  有些stl不常用真的會忘qwq,不如在這裏記下來,以後常來看看 

C++中substr函數的用法

 1 #include<string> 
 2 #include<iostream> 
 3 using namespace std;
 4 
 5 void main() 
 6 { 
 7 string s("12345asdf"); 
 8 string a=s.substr(0,5);
 9 cout<<a<<endl;
10 }

(以上轉自:https://www.cnblogs.com/cynthia-dcg/p/6182514.html)

記一些stl的用法(持續更新)