Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vantoozz/strings
Library for strings manipulations
https://github.com/vantoozz/strings
Last synced: about 2 months ago
JSON representation
Library for strings manipulations
- Host: GitHub
- URL: https://github.com/vantoozz/strings
- Owner: vantoozz
- License: mit
- Created: 2017-11-08T15:57:07.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-15T16:20:38.000Z (about 4 years ago)
- Last Synced: 2024-04-18T02:03:48.249Z (9 months ago)
- Language: PHP
- Size: 76.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Strings
True OOP library for strings manipulation[![Build Status](https://travis-ci.org/vantoozz/strings.svg?branch=master)](https://travis-ci.org/vantoozz/strings)
[![Coverage Status](https://coveralls.io/repos/github/vantoozz/strings/badge.svg?branch=master)](https://coveralls.io/github/vantoozz/strings?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/724532697bb642b293e4f8a3b462a8ee)](https://app.codacy.com/manual/vantoozz/strings?utm_source=github.com&utm_medium=referral&utm_content=vantoozz/strings&utm_campaign=Badge_Grade_Settings)
[![Packagist](https://img.shields.io/packagist/v/vantoozz/strings.svg)](https://packagist.org/packages/vantoozz/strings)The goal of the library is providing an OOP way for strings manipulations.
It works with any object implementing `Stringable` interface. https://wiki.php.net/rfc/stringable.## Setup
Just run
```bash
composer require vantoozz/strings
```## Transformations
```php
getMessage() . PHP_EOL;
}try {
echo new Email(str('user%example.com')) . PHP_EOL;
} catch (InvalidFormatException $e) {
echo $e->getMessage() . PHP_EOL;
}
```
Will output
```bash
[email protected]
Invalid format
```
### Available formats
* Hostname
* Ipv4
* Ipv6
* Mac
* Sha1
* Sha256
* Url## Composition
```php