Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/hyperia-sk/yii2-string-helpers

String helpers for your Yii2 app
https://github.com/hyperia-sk/yii2-string-helpers

helpers string-helper string-manipulation strings yii2 yii2-extension

Last synced: 4 months ago
JSON representation

String helpers for your Yii2 app

Awesome Lists containing this project

README

        

# Yii2 string helpers

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/hyperia-sk/yii2-string-helpers/master/LICENSE)

> Extension for Yii2 string helpers

## Installation

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```shell
composer require hyperia/yii2-string-helpers:"^1.0"
```

or add

```
"hyperia/yii2-string-helpers": "^1.0"
```

to the require section of your composer.json.

## Available Methods

- contains
- isLonger
- isShorter
- length
- toLower
- toUpper
- firstCharToUpper
- removeAccent

## Usage

```php
use hyperia\helpers\StringHelper;

echo StringHelper::isLonger('This is test string', 12); // 1
echo StrinhHelper::removeAccent('Ħí ŧħə®ë, юßť å test!'); // Hi there, jusst a test!
echo StringHelper::contains('is', 'This is test string'); // 1
```

## Tests
```
./vendor/bin/phpunit
```