1 | <?php namespace Gears\String\Methods; |
||
16 | trait Replace |
||
17 | { |
||
18 | /** |
||
19 | * Replaces all occurrences of $search in $str by $replacement. |
||
20 | * |
||
21 | * @param string|array $search The needle to search for. |
||
22 | * |
||
23 | * @param string|array $replacement The string to replace with. |
||
24 | * |
||
25 | * @param bool $caseSensitive To enforce case-sensitivity or not. |
||
26 | * |
||
27 | * @return static String after the replacements. |
||
28 | */ |
||
29 | public function replace($search, $replacement, $caseSensitive = true) |
||
52 | |||
53 | /** |
||
54 | * Replaces all occurrences of $search from the |
||
55 | * beginning of string with $replacement. |
||
56 | * |
||
57 | * @param string $search |
||
58 | * @param string $replacement |
||
59 | * @return static |
||
60 | */ |
||
61 | public function replaceBeginning($search, $replacement) |
||
69 | |||
70 | /** |
||
71 | * Replaces all occurrences of $search from the |
||
72 | * ending of string with $replacement. |
||
73 | * |
||
74 | * @param string $search |
||
75 | * @param string $replacement |
||
76 | * @return static |
||
77 | */ |
||
78 | public function replaceEnding($search, $replacement) |
||
86 | } |
||
87 |