andydune/string-container

Collection of functions fo string modification. Collection is composed as strategy pattern with simple extension.

v1.0.1 2019-06-21 11:45 UTC

This package is auto-updated.

Last update: 2024-12-22 03:08:34 UTC


README

Build Status Software License Packagist Version Total Downloads

It is collection of functions for string modification. Collection is composed as strategy pattern with simple extension.

Actions with string

Remove duplicate space symbols

It replaces spaces, tabs and so on for regular \s with only one space symbol.

use AndyDune\StringContainer\StringContainer;

$container = new StringContainer('Very    
cool.');
'Very cool' == $container->removeDuplicateSpaces()->getString();

Remove duplicate words

It replaces words, if there are more then one in a string.

use AndyDune\StringContainer\StringContainer;

$container = new StringContainer('Very very cool cooly.');
'Very  cool cooly.' == $container->removeDuplicateWords()->getString();