by pjb@[EMAIL PROTECTED]
(Pascal J. Bourguignon)
May 6, 2008 at 10:45 AM
"friend.blah@[EMAIL PROTECTED]
" <friend.blah@[EMAIL PROTECTED]
> writes:
> i have a string say
>
> string crap = "abc:abd:aass";
>
> at the end of my string i want to place new characters like "xx"
> so the final string looks like
>
> string crap = "abc:abd:aassxx";
>
> how to resolve this issue...
>
> i could able replace colons (:) with other characters but i am failing
> when i wanna place new characters at the end of string.
>
>
> thanks for any help
#include <string>
#include <iostream>
using namespace std;
int main(void){
string a="abc";
a.push_back('.');
a+="def";
a=a+".ghi";
cout<<a<<endl;
return(0);
}
/*
-*- mode: compilation; default-directory: "/tmp/" -*-
Compilation started at Tue May 6 10:44:39
g++ -o a a.c++ && ./a
abc.def.ghi
Compilation finished at Tue May 6 10:44:39
*/
Have a look at:
http://www.cplusplus.com/reference/string/
--
__Pascal Bourguignon__