UnicodeUnspace (Unicode function): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 3: | Line 3: | ||
The <var>UnicodeUnspace</var> [[Intrinsic classes|intrinsic]] function removes the whitespace characters from the <var>[[Unicode class|Unicode]]</var> string method object and it returns the resulting string. Options are available to:<ul><li> | The <var>UnicodeUnspace</var> [[Intrinsic classes|intrinsic]] function removes the whitespace characters from the <var>[[Unicode class|Unicode]]</var> string method object and it returns the resulting string. Options are available to:<ul><li> | ||
Define which character or characters are to be interpreted as whitespace<li>Remove leading whitespace, trailing whitespace, both or neither;<li>Collapse to a single whitespace character any sequences of non-leading, non-trailing whitespace</ul> | Define which character or characters are to be interpreted as whitespace<li>Remove leading whitespace, trailing whitespace, both or neither;<li>Collapse to a single whitespace character any sequences of non-leading, non-trailing whitespace</ul> | ||
==Syntax== | ==Syntax== | ||
{{Template:Unicode:UnicodeUnspace syntax}} | {{Template:Unicode:UnicodeUnspace syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%outUnicode</th><td>A <var>Unicode</var> variable to receive the result of the <var>UnicodeUnspace</var> function.</td></tr> | <tr><th>%outUnicode</th><td>A <var>Unicode</var> variable to receive the result of the <var>UnicodeUnspace</var> function.</td></tr> | ||
<tr><th>unicode</th> | <tr><th>unicode</th> | ||
<td>The method object <var>Unicode</var> string.</td></tr> | <td>The method object <var>Unicode</var> string.</td></tr> | ||
<tr><th><var>Spaces</var></th> | <tr><th><var>Spaces</var></th> | ||
<td><var class="term">Spaces</var> is an optional, [[Methods#Named parameters|name required]], parameter, which is a <var>Unicode</var> string that specifies the set of characters considered to be whitespace. The default set is the blank space (<code>' '</code>) character. If you specify multiple <var class="term">Spaces</var> characters, the first character is the replacement space character: a single one of these is substituted for each sequence (which may be one) of non-leading, non-trailing <var class="term">Spaces</var> characters in the method object string.</td></tr> | <td><var class="term">Spaces</var> is an optional, [[Methods#Named parameters|name required]], parameter, which is a <var>Unicode</var> string that specifies the set of characters considered to be whitespace. The default set is the blank space (<code>' '</code>) character. If you specify multiple <var class="term">Spaces</var> characters, the first character is the replacement space character: a single one of these is substituted for each sequence (which may be one) of non-leading, non-trailing <var class="term">Spaces</var> characters in the method object string.</td></tr> | ||
<tr><th><var>Leading</var></th> | <tr><th><var>Leading</var></th> | ||
<td><var class="term">Leading</var> is an optional, but <var class="term">Name-Required</var>, parameter, which is a <var>[[Enumerations#Using_Boolean_enumerations|"Boolean Enumeration"]]</var> value that specifies whether to strip all leading whitespace characters. The default is <code>True</code>, strip leading whitespace.</td></tr> | <td><var class="term">Leading</var> is an optional, but <var class="term">Name-Required</var>, parameter, which is a <var>[[Enumerations#Using_Boolean_enumerations|"Boolean Enumeration"]]</var> value that specifies whether to strip all leading whitespace characters. The default is <code>True</code>, strip leading whitespace.</td></tr> | ||
<tr><th><var>Trailing</var></th> | <tr><th><var>Trailing</var></th> | ||
<td><var class="term">Trailing</var> is an optional, but <var class="term">Name-Required</var>, parameter, which is a <var>[[Enumerations#Using_Boolean_enumerations|"Boolean Enumeration"]]</var> value that specifies whether to strip all trailing whitespace characters. The default is <code>True</code>, strip trailing whitespace.</td></tr> | <td><var class="term">Trailing</var> is an optional, but <var class="term">Name-Required</var>, parameter, which is a <var>[[Enumerations#Using_Boolean_enumerations|"Boolean Enumeration"]]</var> value that specifies whether to strip all trailing whitespace characters. The default is <code>True</code>, strip trailing whitespace.</td></tr> | ||
<tr><th><var>Compress</var></th> | <tr><th><var>Compress</var></th> | ||
<td><var class="term">Compress</var> is an optional, but <var class="term">Name-Required</var>, parameter, which is a <var>[[Enumerations#Using_Boolean_enumerations|"Boolean Enumeration"]]</var> value that specifies whether to collapse each sequence of spaces to a single space. The default is <code>True</code>, collapse such sequences.</td></tr> | <td><var class="term">Compress</var> is an optional, but <var class="term">Name-Required</var>, parameter, which is a <var>[[Enumerations#Using_Boolean_enumerations|"Boolean Enumeration"]]</var> value that specifies whether to collapse each sequence of spaces to a single space. The default is <code>True</code>, collapse such sequences.</td></tr> | ||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> | ||
<li>Duplicate <var class="term">Spaces</var> characters are tolerated and do not affect the result. | <li>Duplicate <var class="term">Spaces</var> characters are tolerated and do not affect the result. | ||
</ul> | </ul> | ||
==Examples== | ==Examples== | ||
==See also== | ==See also== | ||
{{Template:Unicode:UnicodeUnspace footer}} | {{Template:Unicode:UnicodeUnspace footer}} |
Revision as of 21:13, 30 July 2012
Remove whitespace characters from the string (Unicode class)
[Introduced in Sirius Mods 8.0]
The UnicodeUnspace intrinsic function removes the whitespace characters from the Unicode string method object and it returns the resulting string. Options are available to:
- Define which character or characters are to be interpreted as whitespace
- Remove leading whitespace, trailing whitespace, both or neither;
- Collapse to a single whitespace character any sequences of non-leading, non-trailing whitespace
Syntax
%outUnicode = unicode:UnicodeUnspace[( [Spaces= string], [Leading= boolean], - [Trailing= boolean], - [Compress= boolean])]
Syntax terms
%outUnicode | A Unicode variable to receive the result of the UnicodeUnspace function. |
---|---|
unicode | The method object Unicode string. |
Spaces | Spaces is an optional, name required, parameter, which is a Unicode string that specifies the set of characters considered to be whitespace. The default set is the blank space (' ' ) character. If you specify multiple Spaces characters, the first character is the replacement space character: a single one of these is substituted for each sequence (which may be one) of non-leading, non-trailing Spaces characters in the method object string. |
Leading | Leading is an optional, but Name-Required, parameter, which is a "Boolean Enumeration" value that specifies whether to strip all leading whitespace characters. The default is True , strip leading whitespace. |
Trailing | Trailing is an optional, but Name-Required, parameter, which is a "Boolean Enumeration" value that specifies whether to strip all trailing whitespace characters. The default is True , strip trailing whitespace. |
Compress | Compress is an optional, but Name-Required, parameter, which is a "Boolean Enumeration" value that specifies whether to collapse each sequence of spaces to a single space. The default is True , collapse such sequences. |
Usage notes
- Duplicate Spaces characters are tolerated and do not affect the result.