Jump to content
AlexisNav

change character in string

Recommended Posts

Hello i can't find the tutorials or information for change a character "/" for another "\" in a string. I need them for a entry in a input file

Thank you.

Share this post


Link to post
Share on other sites

Hi Alexis,

the documentation can be searched i.e. for "String" which pops up all the corresponding class functions. You should be able to achieve what you are looking for with the replaceByString command:

image.png.dae0634250697b852b37d591c5b68c24.png

The problem with the backslash symbol is, that it is also used as an escape character. Therefore you need to use a little workaround e.g. as follows:

FString s("a/b")
s.replaceByString("/","\?")
s.replaceByString("?","")

Cheers,
Heinrich

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...