Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
* Email
* Hostname
* Ipv4
* Ipv6
* Mac
* Sha1
* Sha256
* Url

## Composition
```php