Jump to content



Photo

Strings, Quotes And Stuff


  • Please log in to reply
4 replies to this topic

#1 Newbie2

Newbie2

    Wayfarer

  • Active Members
  • Pip
  • 61 posts

Posted 03 April 2004 - 10:23 PM

Hi Guys, sorry for this stupid question...

If I do this:
$string=("AB@CD=,123") msgbox (0,"",$string)

It will result-->AB@CD=,123

But what 2 do if I want to result AB@CD=,"123","456",7 ?

I have found that there is a way using "&"

e.g.

$string=("AB@CD=,""" & "123" & """," & """" & "456" & """," & 7) msgbox (0,"",$string)


Is there an other way? Can't I do:
$string=(AB@CD=,"123","456",7) msgbox (0,"",$string)


Thanks-





#2 GrahamS

GrahamS

    Prodigy

  • Active Members
  • PipPipPip
  • 156 posts

Posted 03 April 2004 - 10:30 PM

You can also use the single quote character, so try

$string=('AB@CD=,"123","456",7')

GrahamS

#3 herworth

herworth

    Seeker

  • Active Members
  • 46 posts

Posted 03 April 2004 - 10:32 PM

You can do this:

$string = "ABC = ""123"" or ""678"""
MsgBox(0,"",$string)

You will get - ABC = "123" or "678"
Pete

#4 GrahamS

GrahamS

    Prodigy

  • Active Members
  • PipPipPip
  • 156 posts

Posted 03 April 2004 - 10:33 PM

P.S. look at item 7 in the FAQ. As it says, you can also double up the quote marks as follows:

$string=("AB@CD=,""123"",""456"",7")


but personally the single quote version looks better
GrahamS

#5 Newbie2

Newbie2

    Wayfarer

  • Active Members
  • Pip
  • 61 posts

Posted 03 April 2004 - 10:35 PM

Thanks, GrahamS.

That did it. :whistle:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users