CurrentQuoted (StringTokenizer function): Difference between revisions
m (→Examples) |
m (→Usage notes) |
||
Line 22: | Line 22: | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> | ||
<li>The Quotes characters are initially settable in the [[New (StringTokenizer constructor)|New]] | <li>The <var>Quotes</var> characters are initially settable in the <var>[[New (StringTokenizer constructor)|New]]</var> call that creates the tokenizer instance. | ||
<li>A quotation character may participate in only one quoted region. | <li>A quotation character may participate in only one quoted region. | ||
The first quotation character from the beginning of the tokenization string is | The first quotation character from the beginning of the tokenization string is | ||
paired with the following identical quotation character in the string. | paired with the following identical quotation character in the string. | ||
An unpaired quotation character causes a request cancellation. | An unpaired quotation character causes a request cancellation. | ||
<li>A quoted region is not affected by the [[TokensToLower (StringTokenizer property)|TokensToLower]] | <li>A quoted region is not affected by the <var>[[TokensToLower (StringTokenizer property)|TokensToLower]]</var> | ||
and [[TokensToUpper (StringTokenizer property)|TokensToUpper]] properties. | and <var>[[TokensToUpper (StringTokenizer property)|TokensToUpper]]</var> properties. | ||
<li>The [[RemoveQuotes (StringTokenizer property)|RemoveQuotes]] property controls whether | <li>The <var>[[RemoveQuotes (StringTokenizer property)|RemoveQuotes]]</var> property controls whether | ||
quotes are removed from the returned values of quoted tokens. | quotes are removed from the returned values of quoted tokens. | ||
</ul> | </ul> |
Revision as of 21:09, 3 July 2012
Is current token a quoted token? (StringTokenizer class)
This method returns a Boolean value that indicates whether
the current token is a quoted token.
A quoted token contains all the characters between a pair of identical
quotation characters.
The CurrentQuoted value is True
if the current token is quoted;
otherwise it is False
.
Syntax
%boolean = stringTokenizer:CurrentQuoted
Syntax terms
%boolean | An enumeration object of type Boolean to contain the returned value of CurrentQuoted. For more information about Boolean enumerations, see "Using Boolean Enumerations". |
---|---|
stringTokenizer | A StringTokenizer object expression. |
Usage notes
- The Quotes characters are initially settable in the New call that creates the tokenizer instance.
- A quotation character may participate in only one quoted region. The first quotation character from the beginning of the tokenization string is paired with the following identical quotation character in the string. An unpaired quotation character causes a request cancellation.
- A quoted region is not affected by the TokensToLower and TokensToUpper properties.
- The RemoveQuotes property controls whether quotes are removed from the returned values of quoted tokens.
Examples
In the following request fragment, the selection of a quoted token is verified by a CurrentQuoted call:
%tok = new(quotes='"') %tok:string = 'simple "quoted tokens" example' PrintText {~} is {%tok:nextToken} PrintText {~} is {%tok:nextToken} PrintText {~} is {%tok:currentToken} PrintText {~} is {%tok:currentQuoted}
The result is:
%tok:nextToken is simple %tok:nextToken is quoted tokens %tok:currentToken is quoted tokens %tok:currentQuoted is True
Note: Using the PrintText statement is described in "Targeted Text statements". Printing an enumeration value is described in ToString property "Usage notes".