Snake case
@param  string $value
@param string $delimiter
@return string
18784
public function snakeCase($value, $delimiter = '_')
	{
		$replace = '$1'.$delimiter.'$2';

		return ctype_lower($value) ? $value : strtolower(preg_replace('/(.)([A-Z])/', $replace, $value));
	}
861185
public static function addValue( $source, $value, $delimiter = ' ' )
    {
        $_values = ( !is_array( $source ) ) ? explode( ' ', trim( $source ) ) : $source;
        $_newValues = Convert::createArray( $value );

        foreach ( $_newValues as $_newValue )
        {
            if ( !in_array( $_newValue, $_values ) )
            {
                $_values[] = $_newValue;
            }
        }

        return is_array( $source ) ? $_values : ltrim( implode( $delimiter, $_values ), $delimiter );
    }
1342704
public static function titleCase(
        $value,
        $delimiters = [" ", "-", ".", "'", "O'", "Mc"],
        $exceptions = ["and", "to", "of", "das", "dos", "I", "II", "III", "IV", "V", "VI"]
    ) {
        // if value passed as empty or is not a string then return false
        if (!$value) {
            return false;
        }

        /** @var string $cache Cache Value */
        $cache = self::cacheString($value, $delimiters, $exceptions);

        // check for cache
        if (isset(static::$titleCaseCache[$cache])) {
            return static::$titleCaseCache[$cache];
        }

        /*
         * Exceptions in lower case are words you don't want converted
         * Exceptions all in upper case are any words you don't want converted to title case
         *   but should be converted to upper case, e.g.:
         *   king henry viii or king henry Viii should be King Henry VIII
         */
        $value = mb_convert_case($value, MB_CASE_TITLE, "UTF-8");
        foreach ($delimiters as $delimiter) {
            $words = explode($delimiter, $value);
            $newWords = [];
            foreach ($words as $word) {
                if (in_array(mb_strtoupper($word, "UTF-8"), $exceptions)) {
                    // check exceptions list for any words that should be in upper case
                    $word = mb_strtoupper($word, "UTF-8");
                } elseif (in_array(mb_strtolower($word, "UTF-8"), $exceptions)) {
                    // check exceptions list for any words that should be in upper case
                    $word = mb_strtolower($word, "UTF-8");
                } elseif (!in_array($word, $exceptions)) {
                    // convert to uppercase (non-utf8 only)
                    $word = ucfirst($word);
                }
                array_push($newWords, $word);
            }
            $value = join($delimiter, $newWords);
        }
        return static::$formatForTitleCache[$cache] = $value;
    }
210642
protected function decodeArrayValue($value, $delimeter = '|')
    {
        if (strpos($value, $delimeter) === false) return [$value];

        $data = preg_split('~(?<!\\\)' . preg_quote($delimeter, '~') . '~', $value);
        $newData = [];

        foreach ($data as $_value) {
            $newData[] = str_replace('\\'.$delimeter, $delimeter, $_value);
        }

        return $newData;
    }
27298
private static function wildcardToRegex(string $wildcardPattern, string $delimiter = '/'): string
    {
        $converted = preg_quote($wildcardPattern, $delimiter);
        $converted = str_replace('\*', '.*', $converted);

        return $converted;
    }
233295
public static function camelCase($value, $firstLower = false)
  {
      $value = preg_replace('/[^a-zA-Z0-9\s]/', ' ', $value);
      $value = lcfirst($value);
      $values = static::split(' ', $value);
      for ($i = 1; $i < count($values); ++$i) {
          $values[$i] = ucfirst($values[$i]);
      }

      return implode('', $values);

    // $val = str_replace(' ', '', ucwords(str_replace('_', ' ', $value)));
    // if ($firstLower) $val = strtolower(substr($val,0,1)).substr($val,1);
    // return $val;
  }
190730
public static final String escapeString(final String delimiter,
            final String input) {
        final String escaped = escapeString(input);
        if (escaped.isEmpty()) {
            return escaped;
        }
        return delimiter + escaped;
    }
981601
private function parseScalar(string $key, $value): string
    {
        return sprintf('%s%s%s', $key, $this->delimiter, $value);
    }
420570
public function concat(array $values, string $delimiter = ''): string
    {
        if ($delimiter) {
            return implode(' + ' . $delimiter . ' + ', $values);
        }

        return implode(' + ', $values);
    }
857388
public static function snakeCaseToCamelCase($value): string
    {
        $value = ToString::toString($value);
        $parts = explode('_', $value);
        $camelCased = '';
        foreach ($parts as $part) {
            $camelCased .= mb_convert_case($part, MB_CASE_TITLE);
        }
        return $camelCased;
    }
1171387
public static function kebabCase(string $value, bool $toLowerCase = true): string
    {
        return static::snakeCase($value, $toLowerCase, '-');
    }
684737
protected function pregQuote($value, $delimiter = '/')
    {
        if (is_array($value) || is_object($value)) {
            foreach ($value as &$_value) {
                $_value = $this->pregQuote($_value, $delimiter);
            } // unset($_value); // Housekeeping.
            return $value;
        }
        return preg_quote((string) $value, (string) $delimiter);
    }
1300713
public function toSnakeCase(string $separator = '_'): self
    {

        return $this->toCamelCase()
            ->replace('/[A-Z]/', function ($piece) use ($separator) {
                return sprintf('%s%s', $separator, strtolower($piece));
            });
    }
1093853
public function setValue($value)
	{
		if ($value instanceof Range) {
			$str = $value->from->format($this->format) . $this->delimiter . $value->to->format($this->format);
			return parent::setValue($str);
		} else {
			return parent::setValue((string) $value);
		}
	}
515809
function snake( string $delimiter = '_' ) : SplString
    {
        $string = $this->__toString();
        if( !ctype_lower( $string ) ){
            $string = preg_replace( '/\s+/u', '', ucwords( $this->__toString() ) );
            $string = $this->setString( preg_replace( '/(.)(?=[A-Z])/u', '$1'.$delimiter, $string ) );
            $this->setString( $string );
            $this->lower();
        }
        return $this;
    }
327020
protected function _enclose_value($value = null, $delimiter) {
        if ($value !== null && $value != '') {
            $delimiter_quoted = $delimiter ?
                preg_quote($delimiter, '/') . "|"
                : '';
            $enclosure_quoted = preg_quote($this->enclosure, '/');
            $pattern = "/" . $delimiter_quoted . $enclosure_quoted . "|\n|\r/i";
            if ($this->enclose_all || preg_match($pattern, $value) || ($value{0} == ' ' || substr($value, -1) == ' ')) {
                $value = str_replace($this->enclosure, $this->enclosure . $this->enclosure, $value);
                $value = $this->enclosure . $value . $this->enclosure;
            }
        }

        return $value;
    }
1306222
public static function slugify($str, $delimiter = '-')
    {
        $temp = preg_replace(
            '/[^a-z0-9]/',
            $delimiter,
            strtolower(trim(strip_tags($str)))
        );

        return preg_replace('/-{2,}/', $delimiter, $temp);
    }