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: 22 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 (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-04T01:50:45.000Z (about 3 years ago)
- Last Synced: 2025-08-04T15:30:00.603Z (3 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
```