TokensToLower (StringTokenizer property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>Convert returned tokens to all-lowercase?</b></span>
{{Template:StringTokenizer:TokensToLower subtitle}}
[[Category:StringTokenizer methods|TokensToLower property]]
<!--DPL?? Category:StringTokenizer methods|TokensToLower property: Convert returned tokens to all-lowercase?-->
<!--DPL?? Category:System methods|TokensToLower (StringTokenizer property): Convert returned tokens to all-lowercase?-->
<p>
TokensToLower is a member of the [[StringTokenizer class]].
</p>


This readWrite property returns or sets the Boolean value that indicates
This readWrite property returns or sets the Boolean value that indicates
Line 11: Line 5:
The default value for a new tokenizer is <tt>False</tt>.
The default value for a new tokenizer is <tt>False</tt>.


===Syntax===
==Syntax==
  %bool = %tok:TokensToLower
{{Template:StringTokenizer:TokensToLower syntax}}
 
  %tok:TokensToLower = %bool
===Syntax terms===
===Syntax terms===
<dl>
<dl>
Line 25: Line 17:


</dl>
</dl>
===Usage Notes===
==Usage notes==
<ul>
<ul>
<li>TokensToLower has no effect on non-alphabetic characters.
<li>TokensToLower has no effect on non-alphabetic characters.
Line 31: Line 23:
returned tokens are to be converted to uppercase characters.
returned tokens are to be converted to uppercase characters.
</ul>
</ul>
===Examples===
==Examples==


In the following example,
In the following example,
Line 61: Line 53:
     %tok:nextToken is z}
     %tok:nextToken is z}
</pre>
</pre>
==See also==
{{Template:StringTokenizer:TokensToLower footer}}

Revision as of 19:54, 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