function public static function Unicode::escapeDelimiter

8.x-3.x Unicode.php public static Unicode::escapeDelimiter($string, $delimiter = '.')

Escapes a delimiter in a string.

Note: this is primarily useful in situations where dot notation is used where the values also contain dots, like in a semantic version string.

Parameters

string $string: The string to search in.

string $delimiter: The delimiter to escape.

Return value

string The escaped string.

Class

Unicode
Extends \Drupal\Component\Utility\Unicode.

Namespace

Drupal\bootstrap\Utility

Source src/Utility/Unicode.php (line 109)

public static function escapeDelimiter($string, $delimiter = '.') {
  return str_replace($delimiter, "\\$delimiter", $string);
}