Jump to content

Something wrong with my replace line


dickep
 Share

Recommended Posts

OK, here is the text I have input:

$myText = "1967 New Yorker, V-8,124"" wb"

I want to replace the double quotes with the pipe character. I am using this line of code:

MsgBox(0,"Before", "Text before: " & $myText)

StringReplace($myText, '""', '|')

MsgBox(0,"After", "Text after: " & $myText)

However, when I look at the result, it has not changed. Why? What is wrong - besides me. I can't figure it out.

Thanks for the help.

E

Link to comment
Share on other sites

@dickep

Read the first MsgBox instead of just glance through it and you will notice something, the two "" is only " in the MsgBox. Why is that? I'm not gonna tell you when it's speller out perfectly in the helpfile. See Language Reference - Datatypes.

Link to comment
Share on other sites

GMK, thanks for pointing out my error. :)

AdmiralAlkex, I read that. I was just trying to see the pipe in the result but it did not show up. ;)

Both of you pointed out that I read the helpfile but did not READ the helpfile. Would have seen that you have put the "stuff" back into the variable. ;)

All is good now. Just need to finish the project and move the the next.

E

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...