|
|
(96 intermediate revisions by 4 users not shown) |
Line 1: |
Line 1: |
| ===The CompressSpaces, FoldDoubledQuotes, and QuotesBreak methods===
| | Content moved to M204Int, but history preserved here. |
| These readWrite properties all return or set a boolean value.
| |
| | |
| ====The CompressSpaces property====
| |
| <var>CompressSpaces</var> compresses the intermediate spaces in a string of whitespace characters.
| |
| For example, consider the following <code>%toke</code> <var>StringTokenizer</var> string, defined with a blank as the whitespace character and with comma as a non-token [[Janus SOAP ULI V7.8 changes#Separators|separator]] character:
| |
| <p class="pre"> this, is a compression , example
| |
| </p>
| |
| Without compression, repeated calls of <code>%toke:NextToken</code> strip the leading and trailing whitespace and select the following tokens:
| |
| <p class="pre"> this
| |
| is a compression
| |
| example
| |
| </p>
| |
| Without compression, that is, with <var>CompressSpaces</var> set to <code>True</code>, the result is:
| |
| <p class="pre"> this
| |
| is a compression
| |
| example
| |
| </p>
| |
| <var>CompressSpaces</var> compresses a token's intermediate whitespace
| |
| to a single whitespace character. If multiple whitespace
| |
| characters are defined, the first character in the <var>Spaces</var> string is the character to which intermediate whitespace is compressed. For example, if <code>Spaces='X '</code>, the token
| |
| 'foot ball' will compress to 'footXball'.
| |
| | |
| The <var>CompressSpaces</var> default value is <code>False</code>.
| |
| | |
| '''Note:''' <var>CompressSpaces</var> affects
| |
| processing only when one or more <var>Separators</var> characters are set, because otherwise a
| |
| token cannot contain internal whitespace.
| |
| | |
| ====The FoldDoubledQuotes property====
| |
| If the <var>FoldDoubledQuotes</var> property is set to <code>True</code>, the tokenizer considers two adjacent <var>[[Quotes (StringTokenizer property)|Quotes]]</var>
| |
| characters to be an escape sequence for a single quotation character.
| |