473,786 Members | 2,571 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 2492
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
22243
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
5887
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
1477
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
12780
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...
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
3228
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
9497
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,...
1
10110
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
9962
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
7515
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
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
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
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.