|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Parse String in Quotes as without QuotesIn 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 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 Show quoteHide quote "vighnesh" <vighn***@nannacomputers.com> schreef in bericht news:efxVoNpeGHA.1208@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 > > vighnesh wrote:
Show quoteHide quote >Hello EveryOne A string constant has to be given in quotes. A string variable will > >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 > > > > always display its value in debug with the quotes. What is it you are actually trying to do with this non-quoted string? T vighnesh wrote:
> Hello EveryOne strAssociate = strAssociate.Trim(new char[]{'"'});> > 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? > 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 ThankYou VeryMuch
Regards Vighneswar Show quoteHide quote "John B" <jbngspam@yahoo.com> wrote in message news:446d1d83_1@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
Possible to set/reference a property 'dynamically'?
Checked Listbox? network programming with vb Error that I can't figure out Update ODBC DSN Properties in VB.NET Code? Moving Splitter Throws Exception Can't seem to get AcceptButton working when changed in code? Simple Question about two forms Form getting maximize PictureBox with shortcut possible? |
|||||||||||||||||||||||