TokensToUpper (StringTokenizer property): Difference between revisions
m (1 revision) |
m (→Examples) |
||
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 (< | under the default (<var>False</var>) setting of <var>TokensToUpper</var>: | ||
<p class="code">%tok is object stringtokenizer | <p class="code">%tok is object stringtokenizer | ||
%tok = new | %tok = new | ||
Line 43: | Line 43: | ||
</p> | </p> | ||
If < | If <code>%tok:TokensToUpper = True</code> is specified for the instantiated object, | ||
the resulting tokens are: | the resulting tokens are: | ||
<p class="code">%tok:nextToken is BAD,F | <p class="code">%tok:nextToken is BAD,F |
Revision as of 21:07, 5 July 2012
Convert returned tokens to all-uppercase (StringTokenizer class)
This readWrite property returns or sets the Boolean value that indicates
whether to convert returned, non-quoted, tokens to all-uppercase characters.
The default value for a new tokenizer is False
.
Syntax
%currentBoolean = stringTokenizer:TokensToUpper stringTokenizer:TokensToUpper = newBoolean
Syntax terms
%currentBoolean | An Boolean enumeration object to contain the returned value of TokensToUpper. 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 TokensToUpper property. |
Usage notes
- TokensToUpper has no effect on non-alphabetic characters.
- The TokensToLower property specifies or reports whether returned tokens are to be converted to lowercase characters.
Examples
In the following example, the input string's tokens are returned in sequence under the default (False) setting of TokensToUpper:
%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:TokensToUpper = 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}