Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Strings - Find And Replace

This topic is 5767 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Basically, i need a string function that will replace every occurence of a character in a string with another. More specifically: I need to replace the ''/'' in a dir string e.g. "F:/Music/Anything.mp3" with "//" so it can be used as a file pointer. I was wondering if there was an str command to do this, maybe something along the lines of: str...(MyString, "/", "//"); I''ve looked through MSDN and havn''t been able to find anything. Can anyone help?

Share this post

Link to post
Share on other sites
You can use forward (/) slashes as file name seperators, you don''t need a double slash. It''s only with back (\) slashes because they start escape sequences.

I don''t think there is a find and replace per se, but one of the functions like strstr might help out.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!