TokensToLower (StringTokenizer property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 10: Line 10:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%bool</th>
<tr><th>%bool</th>
<td>An enumeration object of type Boolean to contain the returned value of TokensToLower. For more information about Boolean enumerations, see [[Using Boolean enumerations]]. </td></tr>
<td>An enumeration object of type Boolean to contain the returned value of <var>TokensToLower</var>. For more information about Boolean enumerations, see [[Using Boolean enumerations]]. </td></tr>
<tr><th>%tok</th>
<tr><th>%tok</th>
<td>A StringTokenizer object variable.</td></tr>
<td>A <var>StringTokenizer</var> object variable.</td></tr>
</table>
</table>
==Usage notes==
==Usage notes==
<ul>
<ul>
<li>TokensToLower has no effect on non-alphabetic characters.
<li><var>TokensToLower</var> has no effect on non-alphabetic characters.
<li>The [[TokensToUpper (StringTokenizer property)|TokensToUpper]] property specifies or reports whether
<li>The [[TokensToUpper (StringTokenizer property)|TokensToUpper]] property specifies or reports whether
returned tokens are to be converted to uppercase characters.
returned tokens are to be converted to uppercase characters.
Line 24: Line 24:
In the following example,
In the following example,
the input string's tokens are returned in sequence
the input string's tokens are returned in sequence
under the default (<tt>False</tt>) setting of TokensToLower:
under the default (<tt>False</tt>) setting of <var>TokensToLower</var>:
<pre>
<pre>
     %tok is object stringtokenizer
     %tok is object stringtokenizer
Line 42: Line 42:
</pre>
</pre>


If <tt>%tok:TokensToLower = True</tt> is specified for the instantiated object,
If <tt>%tok:<var>TokensToLower</var> = True</tt> is specified for the instantiated object,
the resulting tokens are:
the resulting tokens are:
<pre>
<pre>

Revision as of 21:47, 6 February 2011

Convert returned tokens to all-lowercase (StringTokenizer class)


This readWrite property returns or sets the Boolean value that indicates whether to convert returned, non-quoted, tokens to all-lowercase characters. The default value for a new tokenizer is False.

Syntax

%currentBoolean = stringTokenizer:TokensToLower stringTokenizer:TokensToLower = newBoolean

Syntax terms

%bool An enumeration object of type Boolean to contain the returned value of TokensToLower. For more information about Boolean enumerations, see Using Boolean enumerations.
%tok A StringTokenizer object variable.

Usage notes

  • TokensToLower has no effect on non-alphabetic characters.
  • The TokensToUpper property specifies or reports whether returned tokens are to be converted to uppercase characters.

Examples

In the following example, the input string's tokens are returned in sequence under the default (False) setting of TokensToLower:

    %tok is object stringtokenizer
    %tok = new
    %tok:string = 'Bad,F  ?3mO ,7,{x Z}'
    repeat while not %tok:atEnd
       printText {~} is {%tok:nextToken}
    end repeat

The resulting tokens are:

    %tok:nextToken is Bad,F
    %tok:nextToken is ?3mO
    %tok:nextToken is ,7,{x
    %tok:nextToken is Z}

If %tok:TokensToLower = True is specified for the instantiated object, the resulting tokens are:

    %tok:nextToken is bad,f
    %tok:nextToken is ?3mo
    %tok:nextToken is ,7,{x
    %tok:nextToken is z}

See also