$Lstr Unblank: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(26 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Remove extraneous blanks from longstring</span>
<span class="pageSubtitle">Remove extraneous blanks from longstring</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Lstr_Unblank function is the [[Unspace (String function)]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Lstr_Unblank function is <var>[[Unspace (String function)|Unspace]]</var>.</p>


This function takes a string or longstring input and produces the a copy with leading trailing and duplicate internal blanks (or other pad character) removed.  
This function takes a string or longstring input and produces the a copy with leading trailing and duplicate internal blanks (or other pad character) removed.  
Line 13: Line 13:


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%result = $Lstr_Unblank(longstring, char)
<p class="syntax"><span class="term">%result</span> = $Lstr_Unblank(longstring, char)
<section end="syntax" /></p>
<p class="caption">$Lstr_Unblank function
</p>
</p>
<p class="caption">%RESULT is a copy of longstring with leading, trailing, and extra intermediate blank characters removed.</p>


<var>$Lstr_Unblank</var> acts very much like $UnBlank except
<p><var class="term">%result</var> is a copy of longstring with leading, trailing, and extra intermediate blank characters removed.</p>
 
==Usage notes==
<ul>
<li><var>$Lstr_Unblank</var> acts very much like $UnBlank except:


<ul>
<ul>
Line 26: Line 27:
<li>It can operate on a LONGSTRING input.  
<li>It can operate on a LONGSTRING input.  
<li>It produces a LONGSTRING output.
<li>It produces a LONGSTRING output.
</ul>
</ul>
</ul>


For example
==Examples==
 
<ol>
<p class="code"> %BIG = $Lstr_Unblank(' Rubeus Hagrid ')
<li>To set %BIG to "Rubeus Hagrid":
<p class="code">%BIG = $Lstr_Unblank(' Rubeus Hagrid ')
</p>
</p>


sets %BIG to "Rubeus Hagrid" and
<li>To set %BIG to "Avada!Kedavra":
 
<p class="code">%BIG = $Lstr_Unblank('!!Avada!!!!Kedavra!', '!')
<p class="code"> %BIG = $Lstr_Unblank('!!Avada!!!!Kedavra!', '!')
</p>
</p>
</ol>


sets %BIG to "Avada!Kedavra".
==Products authorizing {{PAGENAMEE}}==
 
 
<p>
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[List of $functions|Sirius functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</li>
<li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
</ul>
</ul>
</p>
<p class="caption">Products authorizing $Lstr_Unblank
</p>


[[Category:$Functions|$Lstr_Unblank]]
[[Category:$Functions|$Lstr_Unblank]]

Latest revision as of 22:52, 20 September 2018

Remove extraneous blanks from longstring

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Lstr_Unblank function is Unspace.

This function takes a string or longstring input and produces the a copy with leading trailing and duplicate internal blanks (or other pad character) removed.

The $Lstr_Unblank function accepts two arguments and returns a string result.

The first argument is an arbitrary string or longstring. This is a required argument.

The second argument is a string containing a single character that is treated as the blank character. This is an optional argument and defaults to a blank.

Syntax

%result = $Lstr_Unblank(longstring, char)

%result is a copy of longstring with leading, trailing, and extra intermediate blank characters removed.

Usage notes

  • $Lstr_Unblank acts very much like $UnBlank except:
    • A character other than blank can be specified as the separator character (argument 2).
    • It cancels the request if the result target is too short to hold the result.
    • It can operate on a LONGSTRING input.
    • It produces a LONGSTRING output.

Examples

  1. To set %BIG to "Rubeus Hagrid":

    %BIG = $Lstr_Unblank(' Rubeus Hagrid ')

  2. To set %BIG to "Avada!Kedavra":

    %BIG = $Lstr_Unblank('!!Avada!!!!Kedavra!', '!')

Products authorizing $Lstr_Unblank