Skip to content

La clase TXT agrupa herramientas para trabajar sobre texto al estilo navaja suiza.

License

Notifications You must be signed in to change notification settings

maximo-perez-villalba/tool-txt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tool-txt

La clase TXT agrupa herramientas para trabajar sobre texto al estilo navaja suiza.

Tools:

startWith

$txt = TXT::create( "Lorem ipsum..." );
$txt->startWith('Lorem '); //TRUE

endWith

TXT::create( "Lorem ipsum..." )->endWith('...'); //TRUE

equals

$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

$text = $otherText = 'Lorem ipsum...';
TXT::create($text)->compare($otherText) === 0; //TRUE

contains

TXT::create('Lorem ipsum...')->contains('rem ip'); //TRUE

lastPart

TXT::create('Lorem|ipsum')->lastPart('|'); //ipsum
TXT::create('Lorem|ipsum')->lastPart('|', TRUE); //|ipsum

firstPart

TXT::create('Lorem|ipsum')->firstPart('|'); //Lorem
TXT::create('Lorem|ipsum')->firstPart('|', TRUE); //Lorem|

toCamelCaseClass

TXT::create('mAke_mE camel-case pLEase')->toCamelCaseClass() == 'MakeMeCamelCasePlease'; //TRUE

toCamelCaseVariable

TXT::create('MAke_mE camel-case pLEase')->toCamelCaseVariable() == 'makeMeCamelCasePlease'; //TRUE

About

La clase TXT agrupa herramientas para trabajar sobre texto al estilo navaja suiza.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages