![]() |
| | #1 |
| Guest
Posts: n/a
| I need to insert a string some where inside of another string. Example: My String. My goofy String. I need to insert 'goofy' inside of 'My String'. see what I mean? Thanks. |
|
| | #2 |
| B26354 Join Date: Jan 2002
Posts: 631
| Hi Spektrum, memmove() comes to mind. Cheers,
__________________ Jason Deckard |
| Deckard is offline | |
| | #3 |
| Guest
Posts: n/a
| thanks! |
|
| | #4 |
| junior member Join Date: Aug 2001
Posts: 144
| if you're using C++, you can use the string Datatype. it provides an insert method.... Code: #include <iostream>
using std::cout;
using std::endl;
#include <string>
using std::string;
int main ()
{
string s1 = "My String";
s1.insert (3, "Goofy "); // insert "Goofy " at position 3
cout << s1 << endl;
return 0;
}
__________________ THIS IS NOT JUST A CHRONICLING OF THINGS WE HAVE DONE IN THE PAST BUT OUR RISE TO POWER. |
| mix0matt is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C++ ini file reader problems | guitarist809 | C++ Programming | 7 | 09-04-2008 06:02 AM |
| RicBot | John_ | C++ Programming | 8 | 06-13-2006 06:52 PM |
| Compile Error that i dont understand | bobthebullet990 | C++ Programming | 5 | 05-05-2006 09:19 AM |
| String editor for a sentence inputted by a user - any suggestions or ideas? | the_newbug | C Programming | 4 | 03-03-2006 02:11 AM |
| Linked List Help | CJ7Mudrover | C Programming | 9 | 03-10-2004 10:33 PM |