TokensToLower (StringTokenizer property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (fix "using boolean enumerations" link)
 
m (fix "using boolean enumerations" link)
Line 3: Line 3:
This readWrite property returns or sets the Boolean value that indicates
This readWrite property returns or sets the Boolean value that indicates
whether to convert returned, non-quoted, tokens to all-lowercase characters.
whether to convert returned, non-quoted, tokens to all-lowercase characters.
The default value for a new tokenizer is <tt>False</tt>.
The default value for a new tokenizer is <code>False</code>.


==Syntax==
==Syntax==
Line 27: Line 27:
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 <var>TokensToLower</var>:
under the default (<code>False</code>) setting of <var>TokensToLower</var>:
<p class="code">%tok is object stringtokenizer
<p class="code">%tok is object stringtokenizer
%tok = new
%tok = new

Revision as of 21:02, 5 July 2012

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

%currentBoolean A Boolean enumeration object to contain the returned value of TokensToLower. For more information about Boolean enumerations, see "Using Boolean Enumerations".
stringTokenizer A StringTokenizer object expression.
newBoolean The Boolean value to assign to stringTokenizer's Editing TokensToLower property.

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