Convert strings from and to AdaCase
, CamelCase
, CobolCase
, KebabCase
, Lowercase
, MacroCase
, PascalCase
, SentenceCase
, SnakeCase
, TitleCase
, TrainCase
, and Uppercase
.
You can install the package via composer:
composer require ghostwriter/case-converter
You can also star (🌟) this repo to find it easier later.
use GhostWriter\CaseConverter\CaseConverter;
$string = 'The quick brown fox jumps over the lazy dog';
// $caseConverter = new CaseConverter();
// or
$caseConverter = CaseConverter::new();
$caseConverter->adaCase($string); // The_Quick_Brown_Fox_Jumps_Over_The_Lazy_Dog
$caseConverter->camelCase($string); // theQuickBrownFoxJumpsOverTheLazyDog
$caseConverter->cobolCase($string); // THE-QUICK-BROWN-FOX-JUMPS-OVER-THE-LAZY-DOG
$caseConverter->dotCase($string); // the.quick.brown.fox.jumps.over.the.lazy.dog
$caseConverter->kebabCase($string); // the-quick-brown-fox-jumps-over-the-lazy-dog
$caseConverter->lowerCase($string); // the quick brown fox jumps over the lazy dog
$caseConverter->macroCase($string); // THE_QUICK_BROWN_FOX_JUMPS_OVER_THE_LAZY_DOG
$caseConverter->pascalCase($string); // TheQuickBrownFoxJumpsOverTheLazyDog
$caseConverter->sentenceCase($string); // The quick brown fox jumps over the lazy dog
$caseConverter->snakeCase($string); // the_quick_brown_fox_jumps_over_the_lazy_dog
$caseConverter->titleCase($string); // The Quick Brown Fox Jumps Over The Lazy Dog
$caseConverter->trainCase($string); // The-Quick-Brown-Fox-Jumps-Over-The-Lazy-Dog
$caseConverter->upperCase($string); // THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
Please see CHANGELOG.md for more information on what has changed recently.
Please see LICENSE for more information on the license that applies to this project.
Please see SECURITY.md for more information on security disclosure process.