1 | <?php namespace Gears\String\Methods; |
||
16 | trait Trim |
||
17 | { |
||
18 | /** |
||
19 | * Removes whitespace from the start and end of the string. |
||
20 | * |
||
21 | * Supports the removal of unicode whitespace. |
||
22 | * Accepts an optional string of characters to |
||
23 | * strip instead of the defaults. |
||
24 | * |
||
25 | * @param string|null $chars Optional string of characters to strip. |
||
26 | * |
||
27 | * @return static |
||
28 | */ |
||
29 | public function trim($chars = null) |
||
35 | |||
36 | /** |
||
37 | * Returns a string with whitespace removed from the start of the string. |
||
38 | * Supports the removal of unicode whitespace. Accepts an optional |
||
39 | * string of characters to strip instead of the defaults. |
||
40 | * |
||
41 | * @param string|null $chars Optional string of characters to strip. |
||
42 | * |
||
43 | * @return static |
||
44 | */ |
||
45 | public function trimLeft($chars = null) |
||
49 | |||
50 | /** |
||
51 | * Returns a string with whitespace removed from the end of the string. |
||
52 | * Supports the removal of unicode whitespace. Accepts an optional |
||
53 | * string of characters to strip instead of the defaults. |
||
54 | * |
||
55 | * @param string|null $chars Optional string of characters to strip. |
||
56 | * |
||
57 | * @return static |
||
58 | */ |
||
59 | public function trimRight($chars = null) |
||
63 | |||
64 | /** |
||
65 | * Internal helper method for trim methods. |
||
66 | * |
||
67 | * @param string $chars |
||
68 | * @return string |
||
69 | */ |
||
70 | protected function getTrimChars($chars) |
||
81 | } |
||
82 |