Quotes (StringTokenizer property): Difference between revisions
Jump to navigation
Jump to search
m (1 revision: CharacterMap, RandomNumberGenerator, StringTokenizer methods) |
mNo edit summary |
||
Line 1: | Line 1: | ||
<span style="font-size:120%; color:black"><b>Characters which are quotation characters</b></span> | <span style="font-size:120%; color:black"><b>Characters which are quotation characters</b></span> | ||
[[Category:StringTokenizer methods|Quotes property]] | [[Category:StringTokenizer methods|Quotes property]] | ||
<!--DPL?? Category:StringTokenizer methods|Quotes property: Characters which are quotation characters--> | <!--DPL?? Category:StringTokenizer methods|Quotes property: Characters which are quotation characters--> | ||
<!--DPL?? Category:System methods|Quotes (StringTokenizer property): Characters which are quotation characters--> | <!--DPL?? Category:System methods|Quotes (StringTokenizer property): Characters which are quotation characters--> |
Revision as of 19:57, 31 December 2010
Characters which are quotation characters
Quotes is a member of the StringTokenizer class.
This readWrite property returns or sets the characters that are recognized as quotation characters. The text between each disjoint pair of identical quotation characters (a “quoted region”) is treated as a single token, and any delimiter characters (Quote, Space, or TokenChar) within a quoted region are treated as non-delimiters.
Syntax
%chars = %tok:Quotes
%tok:Quotes = %chars
Syntax terms
- %chars
- A string variable to contain the returned value of the current quotation characters or to be set as the new value. The default value for a new tokenizer is a null string. If you are setting Quotes, each character in the string is a quotation character — that is, you may not separate characters — and no character may repeat (except for apostrophe, which may be doubled).
- %tok
- A StringTokenizer object variable.
Usage Notes
- No character can be one of the Quotes characters and also be one of either the Spaces characters or the TokenChars characters.
- 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
The following request fragment employs two quotation characters, and it uses the RemoveQuotes method to include the quotation characters in the returned tokens:
%tok = new(Quotes='"+') %tok:string = '+This Quotes example+ is "trivial"' %tok:removeQuotes = False Print %tok:nextToken Print %tok:nextToken Print %tok:nextToken
The result is:
+This Quotes example+ is "trivial"