Skip to content

Commit 6815869

Browse files
committed
Added Str::upper() and Str::sub().
1 parent 3e50684 commit 6815869

File tree

1 file changed

+104
-1
lines changed

1 file changed

+104
-1
lines changed

classes/str.html

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,57 @@ <h4 class="method" id="method_alternator">alternator(*$args)</h4>
286286
</table>
287287
</article>
288288

289+
<article>
290+
<h4 class="method" id="method_upper">upper($str, $encoding = null)</h4>
291+
<p>The <strong>upper</strong> method converts all characters to uppercase. It is equivalent to PHP's strtoupper() for your specific character encoding.</p>
292+
<table class="method">
293+
<tbody>
294+
<tr>
295+
<th class="legend">Static</th>
296+
<td>Yes</td>
297+
</tr>
298+
<tr>
299+
<th>Parameters</th>
300+
<td>
301+
<table class="parameters">
302+
<tr>
303+
<th>Param</th>
304+
<th>Type</th>
305+
<th>Default</th>
306+
<th class="description">Description</th>
307+
</tr>
308+
<tr>
309+
<th><kbd>$string</kbd></th>
310+
<td><em>string</em></td>
311+
<td><em>Required</em></td>
312+
<td>The input string.</td>
313+
</tr>
314+
<tr>
315+
<th><kbd>$encoding</kbd></th>
316+
<td><em>string</em></td>
317+
<td><pre class="php"><code>null</code></pre></td>
318+
<td>The character encoding.</td>
319+
</tr>
320+
</table>
321+
</td>
322+
</tr>
323+
<tr>
324+
<th>Returns</th>
325+
<td>string</td>
326+
</tr>
327+
<tr>
328+
<th>Example</th>
329+
<td>
330+
<pre class="php"><code>Str::upper('User Data'); // returns 'USER DATA'</code></pre>
331+
</td>
332+
</tr>
333+
</tbody>
334+
</table>
335+
</article>
336+
289337
<article>
290338
<h4 class="method" id="method_lower">lower($str, $encoding = null)</h4>
291-
<p>The <strong>lower</strong> method converts all characters to lowercase. It is equivalent to PHP's strtolower() for your specific character encoding.</p>
339+
<p>The <strong>lower</strong> method converts all characters to lowercase. It is equivalent to PHP's strtolower() for your specific character encoding.</p>
292340
<table class="method">
293341
<tbody>
294342
<tr>
@@ -620,6 +668,61 @@ <h4 class="method" id="method_ends_with">ends_with($str, $end, $ignore_case = fa
620668
</table>
621669
</article>
622670

671+
<article>
672+
<h4 class="method" id="method_sub">sub($str, $start, $length = null, $encoding = null)</h4>
673+
<p>The <strong>sub</strong> method returns the portion of the string specified. It is equivalent to PHP's substr() for your specific character encoding.</p>
674+
<table class="method">
675+
<tbody>
676+
<tr>
677+
<th class="legend">Static</th>
678+
<td>Yes</td>
679+
</tr>
680+
<tr>
681+
<th>Parameters</th>
682+
<td>
683+
<table class="parameters">
684+
<tr>
685+
<th>Param</th>
686+
<th>Default</th>
687+
<th class="description">Description</th>
688+
</tr>
689+
<tr>
690+
<th><kbd>$str</kbd></th>
691+
<td><em>required</em></td>
692+
<td>The input string.</td>
693+
</tr>
694+
<tr>
695+
<th><kbd>$start</kbd></th>
696+
<td><em>required</em></td>
697+
<td>Position of first character. See <a href="http://php.net/substr" target="_blank">php.net</a> for detailed usage.</td>
698+
</tr>
699+
<tr>
700+
<th><kbd>$length</kbd></th>
701+
<td><pre class="php"><code>null</code></pre></td>
702+
<td>Maximum number of characters. See <a href="http://php.net/substr" target="_blank">php.net</a> for detailed usage.</td>
703+
</tr>
704+
<tr>
705+
<th><kbd>$encoding</kbd></th>
706+
<td><pre class="php"><code>null</code></pre></td>
707+
<td>The character encoding.</td>
708+
</tr>
709+
</table>
710+
</td>
711+
</tr>
712+
<tr>
713+
<th>Returns</th>
714+
<td>string</td>
715+
</tr>
716+
<tr>
717+
<th>Example</th>
718+
<td>
719+
<pre class="php"><code>Str::sub('User Data', 3, -1); // returns 'r Dat'</code></pre>
720+
</td>
721+
</tr>
722+
</tbody>
723+
</table>
724+
</article>
725+
623726
</div>
624727

625728
<footer>

0 commit comments

Comments
 (0)