Home All Groups Group Topic Archive Search About

Help needed with Search/Replace

Author
4 Oct 2005 2:45 AM
Mori
I have a string that has several occurrences of \" and I would like to
replace them with "

msg = msg.Replace("\"", """);  //this does not work

Any suggestions?

Author
4 Oct 2005 2:58 AM
Lloyd Dupont
>I have a string that has several occurrences of \" and I would like to
> replace them with "
>
> msg = msg.Replace("\"", """);  //this does not work
>
> Any suggestions?

what about that:
msg = msg.Replace("\\\", "\"")
Author
4 Oct 2005 3:26 AM
Mori
Thanks, but it did not work and has some sysntax errors
Show quote
"Lloyd Dupont" wrote:

> >I have a string that has several occurrences of \" and I would like to
> > replace them with "
> >
> > msg = msg.Replace("\"", """);  //this does not work
> >
> > Any suggestions?
>
> what about that:
> msg = msg.Replace("\\\", "\"")
>
>
>
Author
4 Oct 2005 3:41 AM
Lloyd Dupont
what syntax error?
it does compile and work!
proof of it, I'll send you the an attach sample!

Show quote
"Mori" <M***@discussions.microsoft.com> wrote in message
news:29CF6B4C-7AD4-4922-90A4-6D9F4C728D60@microsoft.com...
> Thanks, but it did not work and has some sysntax errors
> "Lloyd Dupont" wrote:
>
>> >I have a string that has several occurrences of \" and I would like to
>> > replace them with "
>> >
>> > msg = msg.Replace("\"", """);  //this does not work
>> >
>> > Any suggestions?
>>
>> what about that:
>> msg = msg.Replace("\\\", "\"")
>>
>>
>>

[attached file: Program.cs]
Author
4 Oct 2005 3:43 AM
Lloyd Dupont
> Thanks, but it did not work and has some sysntax errors
>> msg = msg.Replace("\\\", "\"")
Oops... right, there is a syntax error:
=> msg = msg.Replace("\\\"", "\"")

however I'm concerned.... can't you solve that?
I would be worry if I were your boss :-/
Author
4 Oct 2005 6:29 AM
CodeBlows
Dim incomingString As String = "bl\ahba\lhbal\hbalh"

        incomingString = incomingString.Replace("\", """")
     ' 4 "'s
        MsgBox(incomingString)

hope this helps

AddThis Social Bookmark Button