From 6815869ade8037422bbd1e5b8f29652e472ae2e3 Mon Sep 17 00:00:00 2001 From: Jonas Stendahl Date: Wed, 22 Aug 2012 23:23:03 +0200 Subject: [PATCH] Added Str::upper() and Str::sub(). --- classes/str.html | 105 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) diff --git a/classes/str.html b/classes/str.html index 9075db420..79078b86d 100644 --- a/classes/str.html +++ b/classes/str.html @@ -286,9 +286,57 @@

alternator(*$args)

+
+

upper($str, $encoding = null)

+

The upper method converts all characters to uppercase. It is equivalent to PHP's strtoupper() for your specific character encoding.

+ + + + + + + + + + + + + + + + + + + +
StaticYes
Parameters + + + + + + + + + + + + + + + + + + + +
ParamTypeDefaultDescription
$stringstringRequiredThe input string.
$encodingstring
null
The character encoding.
+
Returnsstring
Example +
Str::upper('User Data'); // returns 'USER DATA'
+
+
+

lower($str, $encoding = null)

-

The lower method converts all characters to lowercase. It is equivalent to PHP's strtolower() for your specific character encoding.

+

The lower method converts all characters to lowercase. It is equivalent to PHP's strtolower() for your specific character encoding.

@@ -620,6 +668,61 @@

ends_with($str, $end, $ignore_case = fa

+
+

sub($str, $start, $length = null, $encoding = null)

+

The sub method returns the portion of the string specified. It is equivalent to PHP's substr() for your specific character encoding.

+ + + + + + + + + + + + + + + + + + + +
StaticYes
Parameters + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParamDefaultDescription
$strrequiredThe input string.
$startrequiredPosition of first character. See php.net for detailed usage.
$length
null
Maximum number of characters. See php.net for detailed usage.
$encoding
null
The character encoding.
+
Returnsstring
Example +
Str::sub('User Data', 3, -1); // returns 'r Dat'
+
+
+