StringHelper::trimBalanced PHP Méthode

trimBalanced() public méthode

public trimBalanced ( unknown_type $openChar, unknown_type $closeChar ) : StringHelper
$openChar unknown_type
$closeChar unknown_type
Résultat StringHelper
    public function trimBalanced($openChar, $closeChar)
    {
        $stLen = mb_strlen($openChar);
        $endLen = mb_strlen($closeChar);
        while ($this->startsWith($openChar) && $this->endsWith($closeChar)) {
            $this->value = mb_substr($this->value, $stLen, $this->length - ($stLen + $endLen));
            $this->length -= $stLen + $endLen;
        }
        return $this;
    }