API15

Difference between revisions of "JString"

From Joomla! Documentation

(New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description:JString}} ===Defined in=== libra...)
 
m (preparing for archive only)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[Description:JString|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
{{Description:JString}}
 
 
 
===Defined in===
 
===Defined in===
 
libraries/joomla/utilities/string.php
 
libraries/joomla/utilities/string.php
Line 72: Line 67:
 
|UTF-8 aware alternative to strlen Returns the number of characters in the string (NOT THE NUMBER OF BYTES),
 
|UTF-8 aware alternative to strlen Returns the number of characters in the string (NOT THE NUMBER OF BYTES),
 
|}
 
|}
 +
 
===Importing===
 
===Importing===
 
<source lang="php">jimport( 'joomla.utilities.string' );</source>
 
<source lang="php">jimport( 'joomla.utilities.string' );</source>
  
<span class="editsection" style="font-size:76%;">
+
 
<nowiki>[</nowiki>[[SeeAlso:JString|Edit See Also]]<nowiki>]</nowiki>
+
 
</span>
 
{{SeeAlso:JString}}
 
  
 
===Examples===
 
===Examples===
<CodeExamplesForm />
+
=== Code Examples ===
 
<dpl>
 
<dpl>
 
  noresultsheader=\n
 
  noresultsheader=\n
 
  category=JString
 
  category=JString
  category=CodeExample
+
  namespace=CodeExample
 
  category=ClassExample
 
  category=ClassExample
 
  include=*
 
  include=*
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>

Latest revision as of 20:09, 24 March 2017

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Defined in[edit]

libraries/joomla/utilities/string.php

Methods[edit]

Method name Description
strpos UTF-8 aware alternative to strpos Find position of first occurrence of a string
strrpos UTF-8 aware alternative to strrpos Finds position of last occurrence of a string
substr UTF-8 aware alternative to substr Return part of a string given character offset (and optionally length)
str_ireplace UTF-8 aware alternative to str_ireplace Case-insensitive version of str_replace
str_split UTF-8 aware alternative to str_split Convert a string to an array
strcasecmp UTF-8 aware alternative to strcasecmp A case insensivite string comparison
strcspn UTF-8 aware alternative to strcspn Find length of initial segment not matching mask
stristr UTF-8 aware alternative to stristr Returns all of haystack from the first occurrence of needle to the end. needle and haystack are examined in a case-insensitive manner Find first occurrence of a string using case insensitive comparison
strrev UTF-8 aware alternative to strrev Reverse a string
strspn UTF-8 aware alternative to strspn Find length of initial segment matching mask
substr_replace UTF-8 aware substr_replace Replace text within a portion of a string
ltrim UTF-8 aware replacement for ltrim() Strip whitespace (or other characters) from the beginning of a string Note: you only need to use this if you are supplying the charlist optional arg and it contains UTF-8 characters. Otherwise ltrim will work normally on a UTF-8 string
rtrim UTF-8 aware replacement for rtrim() Strip whitespace (or other characters) from the end of a string Note: you only need to use this if you are supplying the charlist optional arg and it contains UTF-8 characters. Otherwise rtrim will work normally on a UTF-8 string
trim UTF-8 aware replacement for trim() Strip whitespace (or other characters) from the beginning and end of a string Note: you only need to use this if you are supplying the charlist optional arg and it contains UTF-8 characters. Otherwise trim will work normally on a UTF-8 string
ucfirst UTF-8 aware alternative to ucfirst Make a string's first character uppercase
ucwords UTF-8 aware alternative to ucwords Uppercase the first character of each word in a string
transcode Transcode a string.
strtolower UTF-8 aware alternative to strtlower Make a string lowercase Note: The concept of a characters "case" only exists is some alphabets such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does not exist in the Chinese alphabet, for example. See Unicode Standard Annex #21: Case Mappings
strtoupper UTF-8 aware alternative to strtoupper Make a string uppercase Note: The concept of a characters "case" only exists is some alphabets such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does not exist in the Chinese alphabet, for example. See Unicode Standard Annex #21: Case Mappings
strlen UTF-8 aware alternative to strlen Returns the number of characters in the string (NOT THE NUMBER OF BYTES),

Importing[edit]

jimport( 'joomla.utilities.string' );



Examples[edit]

Code Examples[edit]