You are here

public static function StringHelper::camelize in RESTful 7.2

Turns a string into camel case.

Parameters

string $input: The input string.

Return value

string The camelized string.

File

src/Util/StringHelper.php, line 26
Contains \Drupal\restful\Util\String.

Class

StringHelper
Class StringHelper.

Namespace

Drupal\restful\Util

Code

public static function camelize($input) {
  $input = preg_replace('/[-_]/', ' ', $input);
  $input = ucwords($input);
  $parts = explode(' ', $input);
  return implode('', $parts);
}