UnicodeAfter (Unicode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (misc cleanup)
m (add link)
Line 33: Line 33:


==Examples==
==Examples==
The following request the left and right square brackets are created using the unicode method and placed in variables %sqL and %sqR.  Depending on your browser's codepage, the square brackets may or may not render correctly. They are then inserted into a unicode string and used to parse that string:
In the following request, the left and right square brackets are created using the <var>[[U (String function)|U]]</var> method and placed in variables <code>%sqL</code> and <code>%sqR</code>.  Depending on your browser's [[Unicode#Code points.2C character set mappings|codepage]], the square brackets may or may not render correctly. The variables are inserted into a <var>Unicode</var> string and used to parse that string:
<p><code>of a B movie: Its plot, about desert-dwelling pagans, makes little sense.</code></p>
<p class="code">begin
<p class="code">begin                                                                          
%sqL      is string len 1 initial("&#x5B;":u) static
%sqL      is string len 1 initial("&#x5B;":u) static                
%sqR      is string len 1 initial("&#x5D;":u) static  
%sqR      is string len 1 initial("&#x5D;":u) static                
%x is unicode
%x is unicode                                                                  
%x = 'Released in 1966, Manos: The Hands of Fate ' with %sql with -
%x = 'Released in 1966, Manos: The Hands of Fate ' with %sql with -            
     ' is a D-minus ' with %sqr with -  
     ' is a D-minus ' with %sqr with -                                          
     ' of a B movie: Its plot, about desert-dwelling pagans, makes little sense.'
     ' of a B movie: Its plot, about desert-dwelling pagans, makes little sense.'
printText {%x:unicodeBefore(%sqR)}                                              
printText {%x:unicodeBefore(%sqR)}
end                                                                            
end
</p>
</p>
<p>
The request result is:</p>
<p class="output">of a B movie: Its plot, about desert-dwelling pagans, makes little sense.</p>


==See also==
==See also==
{{Template:Unicode:UnicodeAfter footer}}
{{Template:Unicode:UnicodeAfter footer}}
The <var>[[UnicodeBefore (Unicode function)|UnicodeBefore]]</var> string method.

Revision as of 00:25, 7 May 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 left and right square brackets are created using the U method and placed in variables %sqL and %sqR. Depending on your browser's codepage, the square brackets may or may not render correctly. The variables are inserted into a Unicode string and used to parse that string:

begin %sqL is string len 1 initial("[":u) static %sqR is string len 1 initial("]":u) static %x is unicode %x = 'Released in 1966, Manos: The Hands of Fate ' with %sql with - ' is a D-minus ' with %sqr with - ' of a B movie: Its plot, about desert-dwelling pagans, makes little sense.' printText {%x:unicodeBefore(%sqR)} end

The request result is:

of a B movie: Its plot, about desert-dwelling pagans, makes little sense.

See also