Text Inside Single Quotation Marks

Prev Next

Introduction

Text inside quotation marks allows practically all characters except the same single quotation mark symbol inside the text. If this is needed, you put the text inside double quotation marks instead.

Spaces

The text may contain any number of leading, trailing and inside spaces.
'Hello   World' differs from 'Hello World'.

Uses

Plain text can be used for

Rules

  • Use single quotation marks (apostrophes) ' ... ' to enclose the text.
  • Inside the quotation marks, all characters are fine, except the single quotation mark which delimits the text.
  • All white spaces, including multiple consecutive spaces preserved.
  • The text must fit on the same line.
    • Exception: Use multi-line text using 3 consecutive quotation marks ''' (apostrophes) as delimiatersto formulate a text requiring multiple lines.
  • Reserved keywords inside quotation marks are treated as text, e.g. 'true'.
  • Various functions and comparisons support wildcard symbols, e.g. ABC = 'A*' returns true.
  • Character entities like € or € for the EURO symbol € are supported. They are converted quasi at compile time to target characters.
  • If the text is assigned to B4P variables or used inside expressions, then the variable assumes the type string and subtype softquoted string.

Good Examples Interpretation Bad Examples Interpretation
'Hello World' Text 'Hello World" Delimits with wrong quotation mark
'123' Text '123 Not properly delimited
' Hello  World ' Text (2 spaces inside)
'' Text (blank value)
'100 €' Text (100 €) 100 € Syntax error: & abd ; are B4P symbols
'-' Text
'true' Text
'"Hi!"' Text, "Hi!"



Examples
       echo( 'Hello World' );
       echo( '  Hello   World  ' );
       echo( 'One + One' );
       echo( '"In double quotation Marks"' );
       echo( 'Price tags: € 10.00, € 10.00, € 10.00');
       echo( '3 * 2 = 6' );
       echo( 'A cheap way to continue on
the next line' ); // Not recommended. Use '...', new line, '...' instead.
       echo( new line, 'Line 1', new line, 'Line 2' );
Hello World
  Hello   World  
One + One
"In double quotation Marks"
Price tags: € 10.00, € 10.00, € 10.00
3 * 2 = 6
A cheap way to continue on
the next line

Line 1
Line 2
Try it yourself: Open LAN_Features_Text_inside_single_quotation_marks.b4p in B4P_Examples.zip. Decompress before use.

See also

Plain text
Text inside double quotation marks
Multi-line text
softquoted strings