Jump to content

[SOLVED] change second occurance in a string


tbare

Recommended Posts

i have a string of names:

 

"French Stuart, Burt Reynolds, Sean Connery"

 

and want this changed to:

 

"French Stuart, Burt Reynolds, & Sean Connery"

 

so, basically, i want to change the second "," to ", &"...

 

how would this be done?

Link to comment
Share on other sites

the 0 tells it not to cut off everything after the insert.

 

If given and is positive' date=' it represents the length of the portion of string  which is to be replaced. If it is negative, it represents the number of characters from the end of string  at which to stop replacing. If it is not given, then it will default to strlen( string  ); i.e. end the replacing at the end of string . Of course, if length  is zero then this function will have the effect of inserting replacement  into string  at the given start  offset. [/quote']
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.