VirtualBox

Changeset 2155 in kBuild for trunk


Ignore:
Timestamp:
Dec 29, 2008 1:01:43 AM (16 years ago)
Author:
bird
Message:

kmk quick ref: added new string functions.

Location:
trunk/kBuild/doc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/doc/QuickReference-kmk.html

    r2147 r2155  
    698698<pre class="literal-block">
    699699$(printf fmt, arg...)
     700</pre>
     701<p>Return the length of a string or a (unexpanded) variable:</p>
     702<pre class="literal-block">
     703$(length string)
     704$(length-var var)
     705</pre>
     706<p>Find the position of <tt class="docutils literal"><span class="pre">needle</span></tt> in <tt class="docutils literal"><span class="pre">haystack</span></tt>, returns 0 if not found.
     707Negative <tt class="docutils literal"><span class="pre">start</span></tt> indices are relative to the end of <tt class="docutils literal"><span class="pre">haystack</span></tt>, while
     708positive ones are one based:</p>
     709<pre class="literal-block">
     710$(pos needle, haystack[, start])
     711$(lastpos needle, haystack[, start])
     712</pre>
     713<p>Returns the specified substring. The <tt class="docutils literal"><span class="pre">start</span></tt> works like with <tt class="docutils literal"><span class="pre">$(pos</span> <span class="pre">)</span></tt>.
     714If the substring is partially outside the <tt class="docutils literal"><span class="pre">string</span></tt> the result will be
     715padded with <tt class="docutils literal"><span class="pre">pad</span></tt> if present:</p>
     716<pre class="literal-block">
     717$(substr string, start[, length[, pad]])
     718</pre>
     719<p>Insert <tt class="docutils literal"><span class="pre">in</span></tt> into <tt class="docutils literal"><span class="pre">str</span></tt> at the specified position. <tt class="docutils literal"><span class="pre">n</span></tt> works like with
     720<tt class="docutils literal"><span class="pre">$(pos</span> <span class="pre">)</span></tt>, except that <tt class="docutils literal"><span class="pre">0</span></tt> is the end of the string:</p>
     721<pre class="literal-block">
     722$(insert in, str[, n[, length[, pad]]])
     723</pre>
     724<p>Translate <tt class="docutils literal"><span class="pre">string</span></tt> exchanging characters in <tt class="docutils literal"><span class="pre">from-set</span></tt> with <tt class="docutils literal"><span class="pre">to-set</span></tt>,
     725optionally completing <tt class="docutils literal"><span class="pre">to-set</span></tt> with <tt class="docutils literal"><span class="pre">pad-char</span></tt> if specified. If no
     726<tt class="docutils literal"><span class="pre">pad-char</span></tt> characters absent in <tt class="docutils literal"><span class="pre">to-set</span></tt> will be deleted:</p>
     727<pre class="literal-block">
     728$(translate string, from-set[, to-set[, pad-char]])
    700729</pre>
    701730</blockquote>
  • trunk/kBuild/doc/QuickReference-kmk.txt

    r2147 r2155  
    340340        $(printf fmt, arg...)
    341341
     342    Return the length of a string or a (unexpanded) variable::
     343
     344        $(length string)
     345        $(length-var var)
     346
     347    Find the position of ``needle`` in ``haystack``, returns 0 if not found.
     348    Negative ``start`` indices are relative to the end of ``haystack``, while
     349    positive ones are one based::
     350
     351        $(pos needle, haystack[, start])
     352        $(lastpos needle, haystack[, start])
     353
     354    Returns the specified substring. The ``start`` works like with ``$(pos )``.
     355    If the substring is partially outside the ``string`` the result will be
     356    padded with ``pad`` if present::
     357
     358        $(substr string, start[, length[, pad]])
     359
     360    Insert ``in`` into ``str`` at the specified position. ``n`` works like with
     361    ``$(pos )``, except that ``0`` is the end of the string::
     362
     363        $(insert in, str[, n[, length[, pad]]])
     364
     365    Translate ``string`` exchanging characters in ``from-set`` with ``to-set``,
     366    optionally completing ``to-set`` with ``pad-char`` if specified. If no
     367    ``pad-char`` characters absent in ``to-set`` will be deleted::
     368
     369        $(translate string, from-set[, to-set[, pad-char]])
     370
    342371
    343372Functions for file names:
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette