API15

JString/strspn: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== UTF-8 aware alternative to strspn Find length of initial segment matching mask <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JStr...
 
m removing red link to edit, no existant pages
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JString/strspn|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JString/strspn}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 55: Line 55:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JString/strspn|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JString/strspn}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
Line 70: Line 70:
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Revision as of 18:51, 12 May 2013

Description

UTF-8 aware alternative to strspn Find length of initial segment matching mask

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

strspn($str, $mask, $start=NULL, $length=NULL)
Parameter Name Default Value Description
$str the haystack
$mask the mask
$start NULL start optional
$length NULL length optional

Defined in

libraries/joomla/utilities/string.php

Importing

jimport( 'joomla.utilities.string' );

Source Body

function strspn($str, $mask, $start = NULL, $length = NULL)
{
        jimport('phputf8.strspn');
        if ( $start === FALSE && $length === FALSE ) {
                return utf8_strspn($str, $mask);
        } else if ( $length === FALSE ) {
                return utf8_strspn($str, $mask, $start);
        } else {
                return utf8_strspn($str, $mask, $start, $length);
        }
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />