将小写下划线字符串转换为驼峰命名

@param $string
@param string $delimiter 分隔符
@return mixed
356319
public static function case2camel($string, $delimiter = '_')
    {
        $reg = '/' . $delimiter . '([a-z])/';
        return preg_replace_callback($reg, function ($mathes) use ($delimiter) {
            return trim(strtoupper($mathes[0]), $delimiter);
        }, $string);
    }
1255244
public static function firstIn(?string $string, ?string $delimiter): ?string
    {
        if (self::likeEmpty($string) || self::likeEmpty($delimiter)) {
            return null;
        }

        return strstr($string, $delimiter, true);
    }
1280321
public static function substringAfter($string, $separator)
    {
        $pos = mb_strpos($string, $separator);
        if ($pos === false) {
            return $string;
        }
        return mb_substr($string, $pos + 1, mb_strlen($string));
    }
974687
public function recvLine($delimiter = "\n") {
        $str = '';
        while (!$this->stream_eof()) {
            $char = $this->recvChr();
            $str .= $char;
            if ($char === false) { return $str; }
            if (strpos($str, $delimiter) !== false) { return $str; }
        }
        return $str;
    }
1199318
private function processParams($uri, $delimiter = ':')
    {
        if (strpos($uri, $delimiter) !== false) {
            preg_match_all(static::paramsRegex(), $uri, $matches, PREG_SET_ORDER);

            foreach ($matches as $match) {
                $param = explode($delimiter, $match[1]);
                if (count($param) === 2) {
                    $plain_var = filter_var($param[1], FILTER_SANITIZE_STRING);
                    $this->params[$param[0]] = $plain_var;
                    $uri = str_replace($match[0], '', $uri);
                }
            }
        }
        return $uri;
    }
771938
public static function getVendorPrefixRegExp($delimiter = null)
    {
        $vendorPrefixValues = self::getVendorPrefixValues();
        foreach ($vendorPrefixValues as $vendorPrefixKey => $vendorPrefixValue) {
            $vendorPrefixValues[$vendorPrefixKey] = preg_quote($vendorPrefixValue, $delimiter);
        }
        return implode('|', $vendorPrefixValues);
    }
103046
public function printLinks($delimiter = null) {
        //If a temporary delimiter is given
        if ($delimiter) {
            //Temporarily set the delimiter to the passed in argument
            $temp = $this->delimiter;
            $this->delimiter = $delimiter;

            //Call the toString with the swapped delimtier
            $return = $this->__toString();

            //Reset the delimiter
            $this->delimiter = $temp;

            //return the result string
            return $return;
        } else {
            //Else, just call to string
            return $this->__toString();
        }
    }
535741
private static function isDelimiter($char, array $delimiters = null)
    {
        if (null === $delimiters) {
            return \ctype_space($char);
        }

        foreach ($delimiters as $delimiter) {
            if ($char === $delimiter) {
                return true;
            }
        }

        return false;
    }
707679
public static function explodeWithCleanup(string $delimiter, string $string): array
    {
        $stringValues = explode($delimiter, $string);
        $parsedValues = [];
        foreach ($stringValues as $k => $v) {
            $v = trim($v);
            if (empty($v)) {
                continue;
            }
            $parsedValues[] = $v;
        }

        return $parsedValues;
    }
37092
public function permalink($string, $delimiter = '-', $option = PINYIN_DEFAULT)
    {
        if (\is_int($delimiter)) {
            list($option, $delimiter) = array($delimiter, '-');
        }

        if (!in_array($delimiter, array('_', '-', '.', ''), true)) {
            throw new InvalidArgumentException("Delimiter must be one of: '_', '-', '', '.'.");
        }

        return implode($delimiter, $this->convert($string, $option | \PINYIN_KEEP_NUMBER | \PINYIN_KEEP_ENGLISH));
    }
229155
public function setDelimiter(string $delimiter): self
    {
        if ($delimiter === $this->delimiter) {
            return $this;
        }

        if (1 === strlen($delimiter)) {
            $this->delimiter = $delimiter;
            $this->resetProperties();

            return $this;
        }

        throw new Exception(sprintf('%s() expects delimiter to be a single character %s given', __METHOD__, $delimiter));
    }
844669
public static String removeLeadingDelimiter(String str, String delimiter) {
        if (!str.startsWith(delimiter)) {
            return str;
        } else {
            return str.substring(delimiter.length(), str.length());
        }
    }
256554
public function getLocalization($delimiter = '_')
    {
        @trigger_error(__METHOD__ . '() is deprecated since version 1.2 and will be removed in 2.0. Use getLocale() instead.', E_USER_DEPRECATED);

        $localization = $this->getLanguage();
        if (null != $this->getCountry()) {
            $localization .= $delimiter . $this->getCountry();
        }

        return $localization;
    }
122124
public static function snake($str, $delimiter = '_')
    {
        $str = preg_replace('/\s+/u', $delimiter, $str);

        $str = static::lower(preg_replace_callback('/([A-Z])/u', function ($math) use ($delimiter) {
            return $delimiter.static::lower($math[1]);
        }, $str));

        return trim(preg_replace('/'.$delimiter.'{2,}/', $delimiter, $str), $delimiter);
    }
247525
public function readString($delim = "\x00")
    {

        // Get position of delimiter
        $len = strpos($this->data, $delim, min($this->index, $this->length));

        // If it is not found then return whole buffer
        if ($len === false) {
            return $this->read(strlen($this->data) - $this->index);
        }

        // Read the string and remove the delimiter
        $string = $this->read($len - $this->index);
        ++$this->index;

        return $string;
    }
655904
public function getNestedName(
        string $delimiter = ".",
        string $name = ""
    ): string
    {
        $keys = array_filter([$this->name, $name], "strlen");
        $parent = $this;
        while ($parent = $parent->getParent()) {
            $name = $parent->getName();
            if ($name) {
                array_unshift($keys, $parent->getName());
            }
        }
        return implode($delimiter, $keys);
    }
472146
public function addWordDelimiter($delimiter)
    {
        if (in_array($delimiter, $this->getWordDelimiters())) {
            throw new \Exception("Word delimiter '$delimiter' is already there.");
        }
        if (empty($delimiter)) {
            throw new \Exception('Word delimiter cannot be null.');
        }
        if (is_array($delimiter)) {
            $this->_wordDelimiters = array_merge($this->getWordDelimiters(), $delimiter);
        } else {
            $this->_wordDelimiters[] = $delimiter;
        }
        return $this;
    }