473,326 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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
4 1458
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: mimages | last post by:
Can someone tell me how to parse part of a string? I can use the following: <?php $text = $_SERVER; //$PHP_SELF //(document.url); echo $text; ?> to get this result: "Your currently at...
22
by: Ram Laxman | last post by:
Hi all, I have a text file which have data in CSV format. "empno","phonenumber","wardnumber" 12345,2234353,1000202 12326,2243653,1000098 Iam a beginner of C/C++ programming. I don't know how to...
46
by: vvk4 | last post by:
I have an excel spreadsheet that I need to parse. I was thinking of saving this as a CSV file. And then reading the file using C. The actual in EXCEL looks like: a,b a"b a","b a,",b In CSV...
16
by: Charles Law | last post by:
I have a string similar to the following: " MyString 40 "Hello world" all " It contains white space that may be spaces or tabs, or a combination, and I want to produce an array...
4
by: vighnesh | last post by:
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...
4
by: Michael Yanowitz | last post by:
Hello: If I have a long string (such as a Python file). I search for a sub-string in that string and find it. Is there a way to determine if that found sub-string is inside single-quotes or...
5
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C++ programming. FYI Although I have called...
1
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming. FYI Although I have called this...
5
by: meendar | last post by:
Hi, I just want to parse a character string as below Char * c=abcsyd"loddggg"kjskjdfsdf; I need to stripe out loddgg from c (inside ""). How can i do this in c?
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.