stein197/caser
最新稳定版本:1.0.0
Composer 安装命令:
composer require stein197/caser
包简介
String case converter and parser
README 文档
README
String case converter and parser
This tiny package provides means for converting strings between different cases - such as converting camelCase to snake_case and so on.
Installation
composer require stein197/caser
Usage:
The package provides two functions and one enum:
use Stein197\Caser\Casing; use function Stein197\Caser\convert; use function Stein197\Caser\split; convert('camelCase', Casing::Pascal); // 'CamelCase' convert('PascalCase', Casing::Kebab); // 'pascal-case' split("backgroundColor"); // ['background', 'Color']
The library automatically detects where it should split the string. There are 6 casing options available:
Casing::Camel; // camelCase Casing::Header; // Header-Case Casing::Kebab; // kebab-case Casing::Pascal; // PascalCase Casing::Snake; // snake_case Casing::Upper; // UPPER_CASE
Composer scripts
testRun unit tests
统计信息
- 总下载量: 1.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-03-29