palmtree / string
Object-oriented string manipulation library
Installs: 1 638
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
- palmtree/php-cs-fixer-config: ^2.0
- phpunit/phpunit: ^10.3
- vimeo/psalm: ^5.2
This package is auto-updated.
Last update: 2024-10-26 13:46:53 UTC
README
Object-oriented string manipulation library
Requirements
- PHP >= 8.1
Installation
Use composer to add the package to your dependencies:
composer require palmtree/string
Usage
use function Palmtree\String\s; $str = s('foo bar baz'); $str->startsWith('foo'); // true $str->endsWith('baz'); // true $str->contains('bar'); // true $str->replace('bar', 'qux'); // 'foo qux baz' $str->after('bar'); // ' baz' $str->afterLast('b'); // 'az' $str->beforeFirst('b'); // 'foo ' $str->kebab(); // 'foo-bar-baz' $str->camel(); // 'fooBarBaz' $str->snake(); // 'foo_bar_baz'
Many other methods are provided. Read through the documented source code to see more.
License
Released under the MIT license