Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maximo-perez-villalba/tool-txt
La clase TXT agrupa herramientas para trabajar sobre texto al estilo navaja suiza.
https://github.com/maximo-perez-villalba/tool-txt
cutter library php php7 phpunit phpunit-tests string tool toolkit txt
Last synced: 12 days ago
JSON representation
La clase TXT agrupa herramientas para trabajar sobre texto al estilo navaja suiza.
- Host: GitHub
- URL: https://github.com/maximo-perez-villalba/tool-txt
- Owner: maximo-perez-villalba
- License: gpl-3.0
- Created: 2022-08-02T21:56:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-04T01:50:45.000Z (over 2 years ago)
- Last Synced: 2024-11-28T23:23:49.698Z (2 months ago)
- Topics: cutter, library, php, php7, phpunit, phpunit-tests, string, tool, toolkit, txt
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tool-txt
La clase TXT agrupa herramientas para trabajar sobre texto al estilo navaja suiza.## Tools:
### startWith
```php
$txt = TXT::create( "Lorem ipsum..." );
$txt->startWith('Lorem '); //TRUE
```### endWith
```php
TXT::create( "Lorem ipsum..." )->endWith('...'); //TRUE
```### equals
```php
$text = $otherText = 'Lorem ipsum...';
TXT::create($text)->equals($otherText); //TRUE
```### compare
Comparación de string segura a nivel binario.
Devuelve < 0 si $ext es menor que $therText; > 0 si $text es mayor que $otherText y 0 si son iguales.
@see https://www.php.net/manual/es/function.strcmp.php
```php
$text = $otherText = 'Lorem ipsum...';
TXT::create($text)->compare($otherText) === 0; //TRUE
```### contains
```php
TXT::create('Lorem ipsum...')->contains('rem ip'); //TRUE
```### lastPart
```php
TXT::create('Lorem|ipsum')->lastPart('|'); //ipsum
TXT::create('Lorem|ipsum')->lastPart('|', TRUE); //|ipsum
```### firstPart
```php
TXT::create('Lorem|ipsum')->firstPart('|'); //Lorem
TXT::create('Lorem|ipsum')->firstPart('|', TRUE); //Lorem|
```### toCamelCaseClass
```php
TXT::create('mAke_mE camel-case pLEase')->toCamelCaseClass() == 'MakeMeCamelCasePlease'; //TRUE
```### toCamelCaseVariable
```php
TXT::create('MAke_mE camel-case pLEase')->toCamelCaseVariable() == 'makeMeCamelCasePlease'; //TRUE
```