You are here

public function StringTransformTrait::toCamelCase in Drupal 7 to 8/9 Module Upgrader 8

Converts a string toCamelCase :)

Parameters

string $string: The string to convert.

Return value

string

1 call to StringTransformTrait::toCamelCase()
StringTransformTrait::toTitleCase in src/Utility/StringTransformTrait.php
Converts a string ToTitleCase.

File

src/Utility/StringTransformTrait.php, line 18

Class

StringTransformTrait
Contains methods for transforming strings in various helpful ways.

Namespace

Drupal\drupalmoduleupgrader\Utility

Code

public function toCamelCase($string) {
  return preg_replace_callback('/_[a-z]/', function (array $match) {
    return strtoupper($match[0][1]);
  }, $string);
}