PHPackages                             palmtree/string - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. palmtree/string

ActiveLibrary

palmtree/string
===============

Object-oriented string manipulation library

v1.0.2(2y ago)04.4k↓35.7%MITPHPPHP ^8.1

Since Aug 31Pushed 2y ago1 watchersCompare

[ Source](https://github.com/palmtreephp/string)[ Packagist](https://packagist.org/packages/palmtree/string)[ RSS](/packages/palmtree-string/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

🌴 Palmtree String
=================

[](#palm_tree-palmtree-string)

[![License](https://camo.githubusercontent.com/52e690058ab541cad8611c058568793be0d89fc6a504b36c61941f204751aba5/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70616c6d747265652f737472696e672e737667)](LICENSE)[![Build](https://camo.githubusercontent.com/c2604319ee338e0b584ad9e3d5f06205ddd89621bc1b0daf0a8a304bcee3e7c6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70616c6d747265657068702f737472696e672f6275696c642e79616d6c3f6272616e63683d6d6173746572)](https://github.com/palmtreephp/string/actions/workflows/build.yaml)[![Packagist Version](https://camo.githubusercontent.com/55fa360bda5e8c073b9674284b017711e689edd3a06d30b56424c5f648c85c71/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70616c6d747265652f737472696e67)](https://packagist.org/packages/palmtree/string)

Object-oriented string manipulation library

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1

Installation
------------

[](#installation)

Use composer to add the package to your dependencies:

```
composer require palmtree/string
```

Usage
-----

[](#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](src/Str.php) to see more.

License
-------

[](#license)

Released under the [MIT license](LICENSE)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

3

Last Release

966d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/93cd57de0c03bc08173bbe424ce641b70b1bb9421f8d8fd474a33409a0f1644d?d=identicon)[palmtree](/maintainers/palmtree)

---

Top Contributors

[![andyexeter](https://avatars.githubusercontent.com/u/6660584?v=4)](https://github.com/andyexeter "andyexeter (5 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/palmtree-string/health.svg)

```
[![Health](https://phpackages.com/badges/palmtree-string/health.svg)](https://phpackages.com/packages/palmtree-string)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
