Quoted Strings

Prev Next

Introduction

The data subtype quoted string is applied in following cases:

  • Text inside double quotation marks is written into B4P variables and used in any expressions.
  • Unless specified otherwise, almost all B4P functions which return values of type string are of subtype quoted strings.
  • The contents in quoted strings are always considered and interpreted as literally given:
    • No symbols like '*' or '?' are treated as wildcard symbols for comparisons

With Text Inside Double Quotation Marks
       a[] = "Hello World";
       b[] = "Hello   World";
       c[] = "  Hello World  ";

       echo( 'a[] = "', a[], '"');
       echo( 'b[] = "', b[], '"');
       echo( 'c[] = "', c[], '"');
       echo( 'Subtype of a[] is ', subtype( a[] ) );
       echo( "Simple comparison returning 'false': ", Hello = "*llo" ); // quoted strings support no wildcards
Output:
a[] = "Hello World"
b[] = "Hello   World"
c[] = "  Hello World  "
Subtype of a[] is quoted string
Simple comparison returning 'false': false
Try it yourself: Open LAN_Features_Data_subtype_quoted_strings.b4p in B4P_Examples.zip. Decompress before use.