Results 1 to 9 of 9

Thread: string containing " 's

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367

    string containing " 's

    if i want a string to contain "'s how do I set them

    so say the following

    dim quote as string

    quote = "Jimbob says "Mowed my lawn and found a car!""

  2. #2
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    Just use single quotes.

  3. #3
    Lively Member
    Join Date
    Jan 1999
    Location
    Lincolnshire, UK
    Posts
    111
    Just add the string like this:

    MyString="Chris Said " & chr(34) & "I'm a bloody genius" & chr(34)

    'cos chr(34) is the ascii for "

    Cheers

    Chris

  4. #4
    Lively Member
    Join Date
    May 2001
    Location
    Akureyri, Iceland
    Posts
    69
    dim quote as string

    quote = "Jimbob says ""Mowed my lawn and found a car!"""

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    cant I am building a string to be passed to a mainframe line editor that wants double's

  6. #6
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908
    Or place Chr$(34) in where you want the quotes.
    Code:
    dim quote as string 
    
    quote = "Jimbob says " & Chr$(34) & "Mowed my lawn and found a car!" & Chr$(34)
    -Excalibur

  7. #7
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    Just use single quotes or...
    Code:
    quote = "Jimbob says ""Mowed my lawn and found a car!"" "
    
    'or
    
    quote = "Jimbob says " & chr(34) & "Mowed my lawn and found a car!" & chr(34)

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    thanks dude (dudes now and maybe dudettes too )! I knew that at some point but all the languages I know really sucks sometimes, between c, java, pascal, fortran, algo, scheme,lisp,asm,vb.,haskel,ada,prolog the syntax sometimes runs together.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    good gracious, alot of people replied to that one fast.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width