rtrim

@param string|null $charlist

@return  static
342855
public function trimRight($charlist = null)
    {
        return $this->cloneInstance(
            function (StringObject $new) use ($charlist) {
                $new->string = Mbstring::rtrim($new->string, $charlist);
            }
        );
    }
1054189
public static function webalize(string $s, string $charList = null, bool $lower = true): string
    {
        $s = static::toAscii($s);
        if ($lower) {
            $s = \strtolower($s);
        }
        $s = \preg_replace('#[^a-z0-9' . ($charList !== null ? \preg_quote($charList, '#') : '') . ']+#i', '-', $s);
        $s = \trim($s, '-');

        return $s;
    }
559795
public function keys($charList)
    {
        $this->getDriver()->curl(
            $this->getDriver()->factoryCommand(
                'keys',
                WebDriver_Command::METHOD_POST,
                ['value' => WebDriver_Util::prepareKeyStrokes($charList)]
            )
        );
        return $this;
    }
535870
public function charset($charset = null)
    {
        if (!func_num_args()) {
            return $this->_charset;
        }
        $this->_charset = $charset ? strtoupper($charset) : null;
        return $this;
    }
496863
public function setCharPressed($charPressed)
    {
        $this->keyName     = null;
        $this->keyCode     = null;
        $this->charPressed = (string)$charPressed;
        return $this;
    }
228920
public function stripTags($whiteList = '')
    {
        if (!$this->isString($whiteList)) {
            throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [
                '$whiteList',
                'integer'
            ]);
        }

        $this->val(strip_tags($this->val(), $whiteList));

        return $this;
    }
856527
protected function parseConditionList($conditionList)
    {
        $charset = $this->getCharset();

        $conditions = [];
        foreach (Condition::splitNestedConditions($conditionList) as $normalizedConditionList) {
            $normalizedConditions = [];
            $currentCondition = "";

            if (preg_match('/[^\x00-\x7f]/', $normalizedConditionList)) {
                $isAscii = false;
                $strLen  = mb_strlen($normalizedConditionList, $charset);
                $getAnd  = function($i) use ($normalizedConditionList){return strtolower(substr($normalizedConditionList, $i, 5));};
            } else {
                $isAscii = true;
                $strLen = strlen($normalizedConditionList);
                $getAnd  = function($i) use ($charset, $normalizedConditionList){return mb_strtolower(mb_substr($normalizedConditionList, $i, 5, $charset), $charset);};
            }

            for ($i = 0, $j = $strLen; $i < $j; $i++) {
                if ($isAscii === true) {
                    //$char = substr($normalizedConditionList, $i, 1);
                    $char = $normalizedConditionList[$i];
                } else {
                    $char = mb_substr($normalizedConditionList, $i, 1, $charset);
                }

                if ($char === " " && $getAnd($i) === " and ") {
                    $normalizedConditions[] = new MediaCondition(trim($currentCondition, " \r\n\t\f"));
                    $currentCondition = "";
                    $i += (5 - 1);
                } else {
                    $currentCondition .= $char;
                }
            }
            $currentCondition = trim($currentCondition, " \r\n\t\f");
            if ($currentCondition !== "") {
                $normalizedConditions[] = new MediaCondition(trim($currentCondition, " \r\n\t\f"));
            }

            foreach ($normalizedConditions as $normalizedCondition) {
                $conditions[] = $normalizedCondition;
            }
        }

        return $conditions;
    }
1167115
public static function rtrim(string $s, string $charList = self::TRIM_CHARACTERS): string
    {
        $charList = \preg_quote($charList, '#');

        return static::replace($s, '#[' . $charList . ']+\z#u', '');
    }
697343
function acceptable($list=NULL) {
		$accept=[];
		foreach (explode(',',str_replace(' ','',@$_SERVER['HTTP_ACCEPT']))
			as $mime)
			if (preg_match('/(.+?)(?:;q=([\d\.]+)|$)/',$mime,$parts))
				$accept[$parts[1]]=isset($parts[2])?$parts[2]:1;
		if (!$accept)
			$accept['*/*']=1;
		else {
			krsort($accept);
			arsort($accept);
		}
		if ($list) {
			if (is_string($list))
				$list=explode(',',$list);
			foreach ($accept as $mime=>$q)
				if ($q && $out=preg_grep('/'.
					str_replace('\*','.*',preg_quote($mime,'/')).'/',$list))
					return current($out);
			return FALSE;
		}
		return $accept;
	}
646002
public static void sqlrtrim(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "trim(trailing from ", "rtrim", parsedArgs);
  }
513665
public static function trim(string $s, string $charList = self::TRIM_CHARACTERS): string
    {
        $charList = \preg_quote($charList, '#');

        return static::replace($s, '#^[' . $charList . ']+|[' . $charList . ']+\z#u', '');
    }
1163088
public static function trim($string, $charlist = '\s\xA0')
    {
        $string = str_replace('&nbsp;', ' ', $string);

        return trim(preg_replace('@^[' . $charlist . ']+(.*)[' . $charlist . ']+$@u', '\\1', $string));
    }
962161
public function trimLeft($charlist = null)
    {
        return $this->cloneInstance(
            function (StringObject $new) use ($charlist) {
                $new->string = Mbstring::ltrim($new->string, $charlist);
            }
        );
    }
1163879
public function trim($charlist = null)
    {
        return $this->cloneInstance(
            function (StringObject $new) use ($charlist) {
                $new->string = Mbstring::trim($new->string, $charlist);
            }
        );
    }
378399
public function sanitize($value)
    {
        if (null === $this->_charList) {
            return trim((string) $value);
        } else {
            return trim((string) $value, $this->_charList);
        }
    }
661955
public function extract($str = null)
  {
    if (!$this->canCastToString($str)) {
      throw new \InvalidArgumentException('$str could not be cast to string');
    }
    $str = (string) $str;

    # match $str against $this->regex
    $matches = array();
    if (!preg_match($this->regex, $str, $matches)) {
      return null;
    }
    unset($matches[0]); # we only want the capturing groups

    # combine matches with their capturing group names
    $matches = array_combine($this->keys, $matches);
    $matches = $this->unflatten($matches);

    # cast each element in $matches to integer or float if possible
    array_walk_recursive($matches, array($this, 'typeCast'));

    return empty($matches) ? null : $matches;
  }
58072
public static function find($tasklist, $taskId = null): TaskLists
    {
        $service = static::getGoogleTasks($tasklist);

        $googleTasks = $service->getTask($taskId);

        return static::createFromGoogleTaskLists($googleTasks, $taskId);
    }