UnicodeAfter (Unicode function): Difference between revisions
m (→Examples: multiple tweaks) |
m (→Examples: drop second example) |
||
(One intermediate revision by the same user not shown) | |||
Line 33: | Line 33: | ||
==Examples== | ==Examples== | ||
In the following | In the following request, the given initial string is "Manos: The Hands of Fate [is a D-minus] of a B movie". The substring that follows the left square bracket (<tt>[</tt>) character representation is excerpted by <var>UnicodeAfter</var>. The request uses an [[Release notes for Model 204 version 7.6#New XHTML entities for square-bracket characters|enhancement for square-bracket handling]] introduced in version 7.6 of Model 204. | ||
<p class="code">begin | <p class="code">begin | ||
%x is unicode | %x is unicode | ||
Line 52: | Line 42: | ||
<p> | <p> | ||
The result is:</p> | The result is:</p> | ||
<p class="output">is a D-minus] of a B movie</p | <p class="output">is a D-minus] of a B movie</p> | ||
==See also== | ==See also== | ||
{{Template:Unicode:UnicodeAfter footer}} | {{Template:Unicode:UnicodeAfter footer}} |
Latest revision as of 17:10, 3 June 2016
Part of string after a substring (Unicode class)
[Introduced in Model 204 7.5]
UnicodeAfter operates on a Unicode variable or string and returns the portion of that string after a user-specified delimiter. To get the portion of the string before a delimiter, use the UnicodeBefore method.
Syntax
%outUnicode = unicode:UnicodeAfter( substring, [Start= number])
Syntax terms
%outUnicode | A Unicode variable to hold the output of the parsed input string, unicode. |
---|---|
unicode | A Unicode string that holds the string to be parsed. |
substring | A Unicode string that holds the separator character or characters on which parsing occurs. |
Start | This numeric value is the starting point for parsing. The default value is 1, indicating the beginning of the string.
This is a name required argument, and it cannot be 0. If a value larger than the string length is specified, the method returns a null string. |
Usage notes
- If a starting value is entered, the %outUnicode value is the content of the string that begins after the first occurrence of the delimiter substring encountered after the specified start point, and that ends at the end of the string.
The delimiter string is not a list of individual delimiters; it is a single delimiter which may be multiple characters. If your delimiter is "ok", the method looks for occurrences of those two lowercase letters, and it returns a value that starts after the first occurrence found after the starting point.
- This method is always case-sensitive.
Examples
In the following request, the given initial string is "Manos: The Hands of Fate [is a D-minus] of a B movie". The substring that follows the left square bracket ([) character representation is excerpted by UnicodeAfter. The request uses an enhancement for square-bracket handling introduced in version 7.6 of Model 204.
begin %x is unicode %x = 'Manos: The Hands of Fate [is a D-minus] ':U 'of a B movie' printText {%x:unicodeAfter('[':U)} end
The result is:
is a D-minus] of a B movie