Page 1 of 1

[Solved] Double and single quote for string

Posted: Thu Jan 30, 2025 2:41 pm
by luofeiyu
In python ,string can be enclose by double string or single string

Code: Select all

s1 = "string"
s2 = 'string'
s1 == s2
True
I find that string can only be enclosed by double quote in oobasic.

Code: Select all

s = 'string' 
It is a wrong expression in oobasic.I can't get rules or grammar on string in oobasic.Could you give me some description on string?

Re: Double and single quote for string

Posted: Fri Jan 31, 2025 1:02 am
by JeJe

Re: Double and single quote for string

Posted: Fri Jan 31, 2025 1:06 am
by JeJe
' is used to denote a comment in Basic so can't also be used for a string. Python uses # for comments so ' can be used for strings as well as "