|
-
Aug 22nd, 2010, 03:08 PM
#1
Thread Starter
Hyperactive Member
Replace characters in a char array
How do I replace character's in a char array. I have tried using the STD namespace and that doesent seem to be working. Can anyone help me?
-
Aug 22nd, 2010, 04:26 PM
#2
Frenzied Member
Re: Replace characters in a char array
Use the STL replace:
Code:
char[] str = "i like vb";
replace( str, str+strlen(str), ' ', '' );
cout << str;
My C++ is a little rusty.
-
Aug 22nd, 2010, 04:27 PM
#3
Thread Starter
Hyperactive Member
Re: Replace characters in a char array
 Originally Posted by Zach_VB6
Use the STL replace:
Code:
char[] str = "i like vb";
replace( str, str+strlen(str), ' ', '' );
cout << str;
My C++ is a little rusty. 
Thanks man! But I happend to get it by just using 'erase();', +REP for helping though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|