$Lstr Unblank: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Remove extraneous blanks from longstring<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Remove extraneous blanks from longstring<section end="desc" /></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 [[to be entered]].</p>
<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>


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 11: Line 11:


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.
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==
==Syntax==
<p class="syntax"><section begin="syntax" /> %RESULT = $Lstr_Unblank(longstring, char)
<p class="syntax"><section begin="syntax" /> %RESULT = $Lstr_Unblank(longstring, char)
Line 18: Line 19:
<p class="caption">%RESULT is a copy of longstring with leading, trailing, and extra intermediate blank characters removed.</p>
<p class="caption">%RESULT is a copy of longstring with leading, trailing, and extra intermediate blank characters removed.</p>


$Lstr_Unblank acts very much like $UNBLANK except
$Lstr_Unblank acts very much like $UnBlank except
 
<ul>
<ul>
<li>A character other than blank can be specified as the separator character (argument 2).  
<li>A character other than blank can be specified as the separator character (argument 2).  
<li>It cancels the request if the result target is too short to hold the result.  
<li>It cancels the request if the result target is too short to hold the result.  
Line 28: Line 29:


For example
For example
<p class="code"> %BIG = $Lstr_Unblank(' Rubeus Hagrid ')
<p class="code"> %BIG = $Lstr_Unblank(' Rubeus Hagrid ')
</p>
</p>
sets %BIG to "Rubeus Hagrid" and
sets %BIG to "Rubeus Hagrid" and
<p class="code"> %BIG = $Lstr_Unblank('!!Avada!!!!Kedavra!', '!')
<p class="code"> %BIG = $Lstr_Unblank('!!Avada!!!!Kedavra!', '!')
</p>
</p>
sets %BIG to "Avada!Kedavra&CQ..


For more information see :hdref refid=lstr..  
sets %BIG to "Avada!Kedavra".  


$Lstr_Unblank is only available in ''[[Sirius Mods]]'' Version 6.2 and later.<p>
$Lstr_Unblank is only available in ''[[Sirius Mods]]'' Version 6.2 and later.


<p>
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[Sirius functions]]</li>
Line 48: Line 52:
<li>[[Japanese functions]]</li>
<li>[[Japanese functions]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
</ul>
</ul>
</p>
</p>
<p class="caption">Products authorizing $Lstr_Unblank
<p class="caption">Products authorizing $Lstr_Unblank
</p>
</p>


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

Revision as of 14:16, 11 February 2011

<section begin="desc" />Remove extraneous blanks from longstring<section end="desc" />

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).

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

<section begin="syntax" /> %RESULT = $Lstr_Unblank(longstring, char) <section end="syntax" />

$Lstr_Unblank function

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

$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.

For example

%BIG = $Lstr_Unblank(' Rubeus Hagrid ')

sets %BIG to "Rubeus Hagrid" and

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

sets %BIG to "Avada!Kedavra".

$Lstr_Unblank is only available in Sirius Mods Version 6.2 and later.

Products authorizing $Lstr_Unblank