You are here

public static function Unicode::caseFlip in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Component/Utility/Unicode.php \Drupal\Component\Utility\Unicode::caseFlip()

Flip U+C0-U+DE to U+E0-U+FD and back. Can be used as preg_replace callback.

Parameters

array $matches: An array of matches by preg_replace_callback().

Return value

string The flipped text.

File

core/lib/Drupal/Component/Utility/Unicode.php, line 662
Contains \Drupal\Component\Utility\Unicode.

Class

Unicode
Provides Unicode-related conversions and operations.

Namespace

Drupal\Component\Utility

Code

public static function caseFlip($matches) {
  return $matches[0][0] . chr(ord($matches[0][1]) ^ 32);
}