473,799 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.e xe"

If strAssociation. StartsWith("""" ) Then

strAssociation = Trim(Mid(strAss ociation, 2))

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

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

End If

End If
May 18 '06 #1
4 1478
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******@nanna computers.com> schreef in bericht
news:ef******** ******@TK2MSFTN GP02.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.e xe"

If strAssociation. StartsWith("""" ) Then

strAssociation = Trim(Mid(strAss ociation, 2))

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

strAssociation = Left(strAssocia tion,
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:
strAssociati on = "rundll32.e xe"

If strAssociation. StartsWith("""" ) Then

strAssociation = Trim(Mid(strAss ociation, 2))

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

strAssociation = Left(strAssocia tion,
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.Tr im(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.c om.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.Tr im(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
22244
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 /test.php "
22
872
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 tokenize the comma separated values.I used strtok function reading line by line using fgets.but it gives some weird behavior.It doesnot stripout the "" fully.Could any body have sample code for the same so that it will be helfful for my...
46
12554
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 format looks like: "a,b","a""b","a"",""b","a,"",b" Does anybody have suggestions or have C program based code to parse CSV. Please reply to the message board itself. I do not wish to get spam.
16
5888
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 with the following elements arr(0) = "MyString" arr(1) = 40 arr(2) = "Hello world"
4
2493
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 me where I went wrong? Thanks in advance. code:
4
12782
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 double-quotes or not inside any quotes? If so how? Thanks in advance: Michael Yanowitz
5
64652
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 article “How to Parse a File in C++”, we are actually mostly lexing a file which is the breaking down of a stream in to its component parts, disregarding the syntax that stream contains. Parsing is actually including the syntax in order to make...
1
64208
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 article “How to Parse a File in C++”, we are actually mostly lexing a file which is the breaking down of a stream in to its component parts, disregarding the syntax that stream contains. Parsing is actually including the syntax in order to make...
5
2443
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
3230
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", $formName); // 06-22-07 - the next commands try to import all the functions that the
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10485
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10252
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.