https://github.com/ghostwriter/case-converter
Convert strings from and to AdaCase, CamelCase, CobolCase, KebabCase, Lowercase, MacroCase, PascalCase, SentenceCase, SnakeCase, TitleCase, TrainCase, and Uppercase
https://github.com/ghostwriter/case-converter
ada-case camel-case case-converter cobol-case ghostwriter kebab-case lower-case macro-case pascal-case sentence-case snake-case title-case train-case upper-case
Last synced: 28 days ago
JSON representation
Convert strings from and to AdaCase, CamelCase, CobolCase, KebabCase, Lowercase, MacroCase, PascalCase, SentenceCase, SnakeCase, TitleCase, TrainCase, and Uppercase
- Host: GitHub
- URL: https://github.com/ghostwriter/case-converter
- Owner: ghostwriter
- License: other
- Created: 2024-02-10T17:59:53.000Z (over 1 year ago)
- Default Branch: 2.1.x
- Last Pushed: 2025-04-22T00:43:25.000Z (29 days ago)
- Last Synced: 2025-04-22T01:29:04.997Z (29 days ago)
- Topics: ada-case, camel-case, case-converter, cobol-case, ghostwriter, kebab-case, lower-case, macro-case, pascal-case, sentence-case, snake-case, title-case, train-case, upper-case
- Language: PHP
- Homepage: https://github.com/ghostwriter/case-converter
- Size: 396 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Case Converter
[](https://github.com/sponsors/ghostwriter)
[](https://github.com/ghostwriter/case-converter/actions/workflows/automation.yml)
[](https://www.php.net/supported-versions)
[](https://packagist.org/packages/ghostwriter/case-converter)Convert strings from and to `AdaCase`, `CamelCase`, `CobolCase`, `KebabCase`, `Lowercase`, `MacroCase`, `PascalCase`, `SentenceCase`, `SnakeCase`, `TitleCase`, `TrainCase`, and `Uppercase`.
## Installation
You can install the package via composer:
``` bash
composer require ghostwriter/case-converter
```### Star ⭐️ this repo if you find it useful
You can also star (🌟) this repo to find it easier later.
## Usage
```php
use GhostWriter\CaseConverter\CaseConverter;$string = 'The quick, brown fox jumps over the lazy dog.';
// $caseConverter = new CaseConverter();
// or
$caseConverter = CaseConverter::new();// The_Quick_Brown_Fox_Jumps_Over_The_Lazy_Dog
$caseConverter->toAdaCase($string);// theQuickBrownFoxJumpsOverTheLazyDog
$caseConverter->toCamelCase($string);// THE-QUICK-BROWN-FOX-JUMPS-OVER-THE-LAZY-DOG
$caseConverter->toCobolCase($string);// the.quick.brown.fox.jumps.over.the.lazy.dog
$caseConverter->toDotCase($string);// the-quick-brown-fox-jumps-over-the-lazy-dog
$caseConverter->toKebabCase($string);// the quick brown fox jumps over the lazy dog
$caseConverter->toLowerCase($string);// THE_QUICK_BROWN_FOX_JUMPS_OVER_THE_LAZY_DOG
$caseConverter->toMacroCase($string);// TheQuickBrownFoxJumpsOverTheLazyDog
$caseConverter->toPascalCase($string);// The quick brown fox jumps over the lazy dog
$caseConverter->toSentenceCase($string);// the_quick_brown_fox_jumps_over_the_lazy_dog
$caseConverter->toSnakeCase($string);// The Quick Brown Fox Jumps Over The Lazy Dog
$caseConverter->toTitleCase($string);// The-Quick-Brown-Fox-Jumps-Over-The-Lazy-Dog
$caseConverter->toTrainCase($string);// THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
$caseConverter->toUpperCase($string);
```### Credits
- [Nathanael Esayeas](https://github.com/ghostwriter)
- [All Contributors](https://github.com/ghostwriter/case-converter/contributors)### Changelog
Please see [CHANGELOG.md](./CHANGELOG.md) for more information on what has changed recently.
### License
Please see [LICENSE](./LICENSE) for more information on the license that applies to this project.
### Security
Please see [SECURITY.md](./SECURITY.md) for more information on security disclosure process.