467,867 Members | 1,344 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,867 developers. It's quick & easy.

Parse String in Quotes as without Quotes

Hello EveryOne

In my project I have to parse a string in Quotes as without Quotes.I tried
the following code but it didn't work to me.
I again getting the string with Quotes, Can Anybody suggest me where I went
wrong?

Thanks in advance.

code:
strAssociation = "rundll32.exe"

If strAssociation.StartsWith("""") Then

strAssociation = Trim(Mid(strAssociation, 2))

If strAssociation.IndexOf("""") > 0 Then

strAssociation = Left(strAssociation,
strAssociation.IndexOf("""") - 1)

End If

End If
May 18 '06 #1
  • viewed: 2218
Share:
4 Replies
Vignesh are you sure that the quotes are there, in the debugger the string
is showed with Quotes.

You have to look in a messagebox or something to see if there are no quotes.

I think that the people in the C# newsgroup are not so happy with your
crossposting by the way, with complete typical VB code.

Cor

"vighnesh" <vi******@nannacomputers.com> schreef in bericht
news:ef**************@TK2MSFTNGP02.phx.gbl...
Hello EveryOne

In my project I have to parse a string in Quotes as without Quotes.I tried
the following code but it didn't work to me.
I again getting the string with Quotes, Can Anybody suggest me where I
went wrong?

Thanks in advance.

code:
strAssociation = "rundll32.exe"

If strAssociation.StartsWith("""") Then

strAssociation = Trim(Mid(strAssociation, 2))

If strAssociation.IndexOf("""") > 0 Then

strAssociation = Left(strAssociation,
strAssociation.IndexOf("""") - 1)

End If

End If

May 18 '06 #2
vighnesh wrote:
Hello EveryOne

In my project I have to parse a string in Quotes as without Quotes.I tried
the following code but it didn't work to me.
I again getting the string with Quotes, Can Anybody suggest me where I went
wrong?

Thanks in advance.

code:
strAssociation = "rundll32.exe"

If strAssociation.StartsWith("""") Then

strAssociation = Trim(Mid(strAssociation, 2))

If strAssociation.IndexOf("""") > 0 Then

strAssociation = Left(strAssociation,
strAssociation.IndexOf("""") - 1)

End If

End If

A string constant has to be given in quotes. A string variable will
always display its value in debug with the quotes. What is it you are
actually trying to do with this non-quoted string?

T
May 18 '06 #3
vighnesh wrote:
Hello EveryOne

In my project I have to parse a string in Quotes as without Quotes.I tried
the following code but it didn't work to me.
I again getting the string with Quotes, Can Anybody suggest me where I went
wrong?


strAssociate = strAssociate.Trim(new char[]{'"'});

Or you could replace the quotes with "" if you wanted to for the whole
string.

Or the quote character might just be the debugger display :)

<...>

JB
May 19 '06 #4
ThankYou VeryMuch

Regards
Vighneswar
"John B" <jb******@yahoo.com> wrote in message
news:44********@news.iprimus.com.au...
vighnesh wrote:
Hello EveryOne

In my project I have to parse a string in Quotes as without Quotes.I
tried the following code but it didn't work to me.
I again getting the string with Quotes, Can Anybody suggest me where I
went wrong?


strAssociate = strAssociate.Trim(new char[]{'"'});

Or you could replace the quotes with "" if you wanted to for the whole
string.

Or the quote character might just be the debugger display :)

<...>

JB

May 19 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by mimages | last post: by
22 posts views Thread by Ram Laxman | last post: by
46 posts views Thread by vvk4 | last post: by
4 posts views Thread by Michael Yanowitz | last post: by
AdrianH
5 posts views Thread by AdrianH | last post: by
5 posts views Thread by meendar | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.