文字列:: APPEND

文字列(1)
文字列&アペンド(のconst文字&STR);
サブストリング(2)
文字列&アペンド(のconst文字列&strの、size_tのsubpos、size_tのsublen)。
C列(3)
文字列&アペンド(のconstのchar * s)は、
(4)緩衝液
ストリング・アペンド(CONSTのchar * S、size_tのN)。
塗りつぶし(5)
ストリング・アペンド(size_tのN、チャーC)。
範囲(6)
テンプレート<クラスInputIterator> 
   文字列&アペンド(最初InputIterator、InputIterator最後)。
初期化子リスト(7)
ストリング・アペンド(initializer_list <CHAR>イリノイ州)。

名前空間stdを使用。
INTメイン()
{
ストリングS1 = "ABC"。
文字列s2を= "DEF"。
s1.append(S2)。
裁判所未満<< "1" << S1 <<てendl;
文字列S3 = "GHI"。
{試みる
s1.append(S3、4、3)。
}キャッチ(out_of_range){
COUT << "out_of_range" << ENDL。
}
COUT << "2" << S1 << ENDL。
constのchar * S4 = "こんにちは";
s1.append(S4)。
coutの<< S1 <<てendl;
constのchar * S5 = "天気";
s1.append(S5、3)。
coutの<< S1 <<てendl;
s1.append(5、 '$');
coutの<< S1 <<てendl;
文字列S6 = "12345";
s1.append(s6.begin()+ 1、s6.end() - 2)。
coutの<< S1 <<てendl;
initializer_list <チャー> S7 = { 'Q'、 'E'、 'R' 'W'}。
s1.append(S7)。
coutの<< S1 <<てendl;
0を返します。
}

おすすめ

転載: www.cnblogs.com/xpylovely/p/12082244.html