Reverse string.

@param  string $s UTF-8 encoding

@return string
518853
public static function reverse(string $s): string
    {
        if (\function_exists('\iconv')) {
            return \iconv('UTF-32LE', 'UTF-8', \strrev(\iconv('UTF-8', 'UTF-32BE', $s)));
        }

        \preg_match_all('/./us', $s, $ar);

        return \implode('', \array_reverse($ar[0]));
    }
1124847
public function createString($s)
    {
        if (!$this->is_utf8($s)) {
            throw new \InvalidArgumentException("string must be utf-8 encoded value.");
        }

        $this->notNested();
        $this->addByte(0); // null terminated
        $this->startVector(1, strlen($s), 1);
        $this->space -= strlen($s);
        for ($i =  $this->space, $j = 0 ; $j < strlen($s) ; $i++, $j++) {
            $this->bb->_buffer[$i] = $s[$j];
        }
        return $this->endVector();
    }
793092
protected function stripPrependCssCharsetUtf8($css)
    {
        if (!($css = (string) $css)) {
            return $css; // Nothing to do.
        }
        $css        = $this->stripExistingCssCharsets($css);
        return $css = $css ? '@charset "UTF-8";'."\n".$css : $css;
    }
1150825
private function _transliterateFrench ($s)
    {        
        $table = array (
            'â' => 'a',
            'ê' => 'e',
            'î' => 'i',
            'ô' => 'o',
            'û' => 'u',
            'Â' => 'A',
            'Ê' => 'E',
            'Î' => 'I',
            'Ô' => 'O',
            'Û' => 'U',
            'œ' => 'oe',
            'æ' => 'ae',
            'Ÿ' => 'Y',
            'ç' => 'c',
        	'Ç' => 'C',
        );
        return strtr($s, $table);
    }
636260
private static String reverseString(String source) {
    int i;
    int len = source.length();
    StringBuffer dest = new StringBuffer();

    for (i = (len - 1); i >= 0; i--) {
      dest.append(source.charAt(i));
    }
    return dest.toString();
  }
973597
private function adjustString($s)
    {
        if (!is_string($s)) {
            return $s;
        }

        if ($this->config['i18nLib'] === self::VUEX_I18N) {
            $searchPipePattern = '/(\s)*(\|)(\s)*/';
            $threeColons = ' ::: ';
            $s = preg_replace($searchPipePattern, $threeColons, $s);
        }

        return preg_replace_callback(
            '/(?<!mailto|tel):\w+/',
            function ($matches) {
                return '{' . mb_substr($matches[0], 1) . '}';
            },
            $s
        );
    }
1046927
protected function encodeStringLitralForNQuads($s)
    {
        $s = str_replace('\\', '\\\\', $s);
        $s = str_replace("\t", '\t', $s);
        $s = str_replace("\n", '\n', $s);
        $s = str_replace("\r", '\r', $s);
        $s = str_replace('"', '\"', $s);

        return $s;
    }
1143539
private function trimSpecialsChars($s)
    {
        if (count($this->getNotReplacedChars()) == 0) {
            $reg = '~[^-a-z0-9_]+~';
        } else {
            $reg = '~[^-a-z0-9_' . implode('', $this->getNotReplacedChars()) .']+~';
        }
        return preg_replace($reg, '', $s);
    }
1195608
public static String reverse(final String string) {

    return isEmpty(string) ? string : new StringBuilder(string).reverse().toString();
  }
1222934
public static function strtoupper(string $string): string
    {
        return str_replace('ß', 'SS', mb_strtoupper($string, 'UTF-8'));
    }
1253006
public static function normalizeNewLines(string $s): string
    {
        if (\strpos($s, "\r") === false) {
            return $s;
        }

        return \str_replace(["\r\n", "\r"], "\n", $s);
    }
1236074
public function filterSubstring($s)
    {
        //convert to ascii -> translate strange chars
        $s = $this->convertToAscii($s);
        //trim spaces
        $s = $this->trimString($s);
        //replace delimiters with another character
        $s = $this->replaceDelimiters($s);
        //lower chars
        $s = $this->toLowerChars($s);
        //delete chars except a-z0-9
        $s = $this->trimSpecialsChars($s);
        //replace double dashes with single one
        $s = $this->replaceDoubleDelimiterReplacementWithSingle($s);
        //trim dashes on beginning/end of the string
        $s = $this->trimStartAndEndSpaceReplacement($s);
        return $s;
    }
515631
public function reverse() {
        $strLength = $this->length();
        $reversed = '';

        // Loop from last index of string to first
        for ($i = $strLength - 1; $i >= 0; $i--) {
            $reversed .= mb_substr($this->str, $i, 1, $this->encoding);
        }

        return self::create($reversed, $this->encoding);
    }
1024887
public function reverse() {
		if (preg_match_all('/./us', $this->rawString, $matches)) {
			$rawString = join('', array_reverse($matches[0]));

			return new static($rawString, $this->charset);
		}
		else {
			return $this;
		}
	}
332267
private function unescapeLatinCharacters($str)
    {
        if ($this->latinCharacters) {
            $str = vsprintf($str, $this->latinCharacters);
            $this->latinCharacters = array();
        }

        return $str;
    }
1190802
private function _replaceDelimiters ($s)
    {
        foreach ($this->getWordDelimiters() as $delimiter) {
            if ($delimiter == $this->getDelimiterReplacement()) {
                continue;
            }
            if (in_array($delimiter, $this->getNotReplacedChars())) {
                continue;
            }
            
            $s = str_replace($delimiter, $this->getDelimiterReplacement(), $s);
        }
        return $s;
    }
249207
public function reverseTransform($valueAsString)
    {
        if (empty($valueAsString)) {
            $valueAsString = [];
        }
        if (!is_array($valueAsString)) {
            $valueAsString = [$valueAsString];
        }
        return serialize($valueAsString);
    }