UnicodeBefore (Unicode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
 
No edit summary
Line 18: Line 18:
==See also==
==See also==
{{Template:Unicode:UnicodeBefore footer}}
{{Template:Unicode:UnicodeBefore footer}}
{{Template:Unicode:UnicodeAfter subtitle}}
<var>UnicodeAfter</var> 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 <var>[[UnicodeBefore (String function)|UnicodeBefore]]</var> string method.
==Syntax==
{{Template:String:UnicodeAfter syntax}}
===Syntax terms===
<table class="syntaxTable">
<tr><th>%outString</th>
<td>A unicode variable to hold the output of the parsed input unicode string.</td></tr>
<tr><th>string</th>
<td>A unicode string that holds the string to be parsed.</td></tr>
<tr><th>substring</th>
<td>A unicode string that holds the separator character or characters on which parsing occurs.</td></tr>
<tr><th><var>Start</var></th>
<td>number: The starting point for parsing.  The default value is 1, indicating the beginning of the string.  This is a name-optional argument and cannot be 0.  If a value larger than the string is specified, the method always returns a null string.</td></tr>
</table>
==Usage notes==
If a starting value is entered, the %outString is the content of the string beginning after the first occurrence of the delimiter string encountered after the specified start point, and ending at the end of the string.
The delimiter string is not a list of individual delimiters, but a single delimiter which may be multiple characters.  In other words, if your delimiter is 'ok', the method looks for occurrences of those two lower-case letters and returns a value after said occurrence,
This method is always case-sensitive.
==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:
<p><code>Released in 1966, Manos: The Hands of Fate </code></p>
<p class="code">begin                                                                           
%sqL                is string len 1 initial("&#x5B;":u) static                 
%sqR                is string len 1 initial("&#x5D;":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(%sqL)}                                             
end                                                                             
</p>
==See also==
{{Template:String:UnicodeAfter footer}}
The <var>[[UnicodeBefore (Unicode function)|UnicodeBefore]]</var> string method.

Revision as of 21:40, 23 April 2014

Part of string before a substring (Unicode class)

[Introduced in Model 204 7.5]


This page is under construction.

Syntax

%outUnicode = unicode:UnicodeBefore( substring, [Start= number])

Syntax terms

%outUnicodeUnicode
unicode Unicode
substring Unicode
Start number
This default value of this argument is ??.

Usage notes

Examples

See also


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 string method.

Syntax

Template:String:UnicodeAfter syntax

Syntax terms

%outString A unicode variable to hold the output of the parsed input unicode string.
string 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 number: The starting point for parsing. The default value is 1, indicating the beginning of the string. This is a name-optional argument and cannot be 0. If a value larger than the string is specified, the method always returns a null string.

Usage notes

If a starting value is entered, the %outString is the content of the string beginning after the first occurrence of the delimiter string encountered after the specified start point, and ending at the end of the string. The delimiter string is not a list of individual delimiters, but a single delimiter which may be multiple characters. In other words, if your delimiter is 'ok', the method looks for occurrences of those two lower-case letters and returns a value after said occurrence, This method is always case-sensitive.

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:

Released in 1966, Manos: The Hands of Fate

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(%sqL)} end

See also

Template:String:UnicodeAfter footer The UnicodeBefore string method.