Lines Matching defs:charlist
195 * @param string $charlist
201 public static function ltrim($str, $charlist = '')
203 if ($charlist === '') return ltrim($str);
205 //quote charlist for use in a characterclass
206 $charlist = preg_replace('!([\\\\\\-\\]\\[/])!', '\\\${1}', $charlist);
208 return preg_replace('/^[' . $charlist . ']+/u', '', $str);
215 * @param string $charlist
221 public static function rtrim($str, $charlist = '')
223 if ($charlist === '') return rtrim($str);
225 //quote charlist for use in a characterclass
226 $charlist = preg_replace('!([\\\\\\-\\]\\[/])!', '\\\${1}', $charlist);
228 return preg_replace('/[' . $charlist . ']+$/u', '', $str);
235 * @param string $charlist
241 public static function trim($str, $charlist = '')
243 if ($charlist === '') return trim($str);
245 return self::ltrim(self::rtrim($str, $charlist), $charlist);