String to lower and trim

@param $string
@return string
171033
public static function low($string): string
    {
        $cleaned = Str::low($string);
        $cleaned = Str::trim($cleaned);

        return $cleaned;
    }
655656
public function literal($string) {
        $string = trim($string, $this->_escapeCharOpen . $this->_escapeCharClose . $this->_quoteChar);
        return $string;
    }
1121268
public function parseString($string)
    {
        $value = $this->getParser()->parse($string);

        if ($this->trimArrayValues && is_array($value)) {
            return $this->trimArray($value);
        }

        return $value;
    }
535968
private function trimLast($string)
        {
            $length = strlen($string) - 1;

            if (Arrays::in($string{$length}, array('t', 'x'))) {
                $string = substr($string, 0, $length);
            }
        }
425329
protected function trim_left($string, $length) {
        return '...'.core_text::substr($string, core_text::strlen($string)-$length, $length);
    }
238721
public static function strtotitle(string $string): string
    {
        $result = '';
        $splitIntoLowerCaseWords = preg_split("/([\n\r\t ])/", self::strtolower($string), -1, PREG_SPLIT_DELIM_CAPTURE);
        foreach ($splitIntoLowerCaseWords as $delimiterOrValue) {
            $result .= self::strtoupper(self::substr($delimiterOrValue, 0, 1)) . self::substr($delimiterOrValue, 1);
        }
        return $result;
    }
700233
@NotNull
    private static String getLowerCaseString(@NotNull final String string) {
        return StringUtils.strip(string).toLowerCase();
    }
760670
public static function toLower($str)
    {
        return self::$use_mbstring
            ? mb_strtolower($str, self::$char_set)
            : strtolower($str);
    }
287872
public static function spaceless(string $string): string
	{
		$string = self::trim($string);
		$string = self::replace($string, '#\s{2,}#', ' ');
		return $string;
	}
1212732
public static function slugify($string)
    {
        // Replace non-alpha-numerics with dashes
        $string = strtolower(preg_replace(array('/[^a-zA-Z0-9 -]/','/[ -]+/','/^-|-$/'), array('','-',''), $string));

        // Trim dashes from the left side of the string
        $string = ltrim($string, "-");

        // Trim dashes from the right side of the string
        $string = rtrim($string, '-');

        return $string;
    }
299783
public static function toSingleWhitespace($string, $trim = true)
    {
        $string = preg_replace("/\r|\n|\t/", " ", $string);
        $string = preg_replace("/ {2,}/", " ", $string);

        if ($trim) {
            $string = self::trim($string);
        }

        return $string;
    }
693076
public function camelize($string)
    {
        $string = preg_replace('#([A-Z])#', '_\\1', $string);
        $string = strtolower($string);
        $string = trim($string, '_');

        return $string;
    }
1185844
private static function trimEdge($string, $char)
    {
        if (substr($string, 0, 1) == $char) {
            $string = substr($string, 1, -1);
        }

        return $string;
    }
1355648
public static function clean_quotes($string)
    {
        if (static::wrapping_quote_for($string)) {
            $string = substr($string, 1); // remove first character
            $string = substr($string, 0, -1); // remove last
        }

        return $string;
    }
224944
private function clean($string) {
	   $string = str_replace(' ', '', $string);
	   $string = str_replace('-', '', $string);
	   return preg_replace('/[^A-Za-z0-9\-]/', '', $string);
	}
310105
public function clean($string)
    {
        $reg = '#'.preg_quote($this->browser->getHost()).'/ch\d+ \[([^\]]+)\]#';
        $string = preg_replace($reg, '$1', $string);
        $string = preg_replace('/\[[^\[\]]+\]/', '', $string); // remove BB tags

        return $string;
    }
186870
public static function trimNewlines($string)
    {
        $string = str_replace("\n", ' ', $string);
        $string = str_replace("\r", ' ', $string);
        $string = preg_replace('/\s+/', ' ', $string);
        return trim($string);
    }