Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/julles/stringer

Manipulation PHP String Package
https://github.com/julles/stringer

php php5 php7 string string-manipulation stringer

Last synced: 1 day ago
JSON representation

Manipulation PHP String Package

Awesome Lists containing this project

README

        

# Stringer

[![Total Downloads](https://poser.pugx.org/muhamadrezaar/stringer/d/total.svg)](https://poser.pugx.org/muhamadrezaar/stringer/d/total.svg)
[![License](https://poser.pugx.org/muhamadrezaar/stringer/license.svg)](https://poser.pugx.org/muhamadrezaar/stringer/license.svg)
[![License](https://img.shields.io/github/release/julles/stringer.svg?style=flat-square)](https://github.com/julles/stringer/releases)
[![StyleCi](https://github.styleci.io/repos/141759070/shield)](https://github.styleci.io/repos/141759070/shield)

### Introduction

Stringer is stand alone PHP package for string manipulation with an expresive syntax.

### Instalation

This package required composer

``` sh
composer require muhamadrezaar/stringer
```

then in your file php

```
include "vendor/autoload.php";
```

### Example

Here is the basic usage and some examples methods:

``` sh
reverse()->display(); // return "emosewa si php"

$str->substring(0,1)->display(); // return "r"

?>

```

Custom Method

``` sh
custom(function($string){
// your own manipulation syntax
})
->display()
?>

```

Using chaining method

``` sh
$str = stringer('azer')
->reverse()
->replace("a","i")
->repeat(2," ")
->display(); // return "rezi rezi"

```

### Available Methods

| Methods |
| ------- |
| ->reverse() |
| ->substring($start = 0, $end = 0) |
| ->custom(callable $string) |
| ->camelCase($separator = " ") |
| ->appendFirst($first="") |
| ->appendLast($last="") |
| ->repeat($loop=1,$separator="") |
| ->upperFirst() |
| ->lowerFirst() |
| ->upperLast() |
| ->lowerLast() |
| ->replace($search,$replace) |
| ->shuffle() |
| ->reverse() |

### License

https://reza.mit-license.org/

Development will continue fork this repo and pull request