PHP code example of andydune / string-container

1. Go to this page and download the library: Download andydune/string-container library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

andydune / string-container example snippets


use AndyDune\StringContainer\StringContainer;

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

use AndyDune\StringContainer\StringContainer;

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