Download the PHP package delight-im/str without Composer
On this page you can find all versions of the php package delight-im/str. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download delight-im/str
More information about delight-im/str
Files in delight-im/str
Package str
Short Description Convenient object-oriented operations on strings
License MIT
Homepage https://github.com/delight-im/PHP-Str
Informations about the package str
PHP-Str
Convenient object-oriented operations on strings
Requirements
- PHP 5.3.0+
- Multibyte String extension (
mbstring)
- Multibyte String extension (
Installation
-
Include the library via Composer [?]:
- Include the Composer autoloader:
Usage
Usually, you'll want to set up the following shorthand in the global namespace of your PHP code:
This lets you create string objects by simply wrapping strings in s(...).
With that shorthand in place, creating instances from any string is as simple as this:
If you don’t want to set up that shorthand, however, you can still create instances easily:
Available methods
startsWithstartsWithBytesstartsWithCodePoints
startsWithIgnoreCasestartsWithBytesIgnoreCasestartsWithCodePointsIgnoreCase
containscontainsBytescontainsCodePoints
containsIgnoreCasecontainsBytesIgnoreCasecontainsCodePointsIgnoreCase
endsWithendsWithBytesendsWithCodePoints
endsWithIgnoreCaseendsWithBytesIgnoreCaseendsWithCodePointsIgnoreCase
trimtrimStarttrimEndfirstfirstBytesfirstCodePoints
lastlastByteslastCodePoints
byteAtcodePointAtisEmptyisAsciiisPrintableAsciitoLowerCasetoLowerCaseBytestoLowerCaseCodePoints
isLowerCasetoUpperCasetoUpperCaseBytestoUpperCaseCodePoints
isUpperCaseisCapitalizedtruncatetruncateBytestruncateCodePoints
truncateSafelytruncateBytesSafelytruncateCodePointsSafely
countcountBytescountCodePoints
lengthlengthInByteslengthInCodePoints
cutStartcutBytesAtStartcutCodePointsAtStart
cutEndcutBytesAtEndcutCodePointsAtEnd
replacereplaceBytesreplaceCodePoints
replaceIgnoreCasereplaceBytesIgnoreCasereplaceCodePointsIgnoreCase
replaceFirstreplaceFirstBytesreplaceFirstCodePoints
replaceFirstIgnoreCasereplaceFirstBytesIgnoreCasereplaceFirstCodePointsIgnoreCase
replacePrefixreplacePrefixBytesreplacePrefixCodePoints
replaceLastreplaceLastBytesreplaceLastCodePoints
replaceLastIgnoreCasereplaceLastBytesIgnoreCasereplaceLastCodePointsIgnoreCase
replaceSuffixreplaceSuffixBytesreplaceSuffixCodePoints
splitsplitBytessplitCodePoints
splitByRegexwordsbeforeFirstbeforeFirstBytesbeforeFirstCodePoints
beforeLastbeforeLastBytesbeforeLastCodePoints
betweenbetweenBytesbetweenCodePoints
afterFirstafterFirstBytesafterFirstCodePoints
afterLastafterLastBytesafterLastCodePoints
matchesequalsequalsIgnoreCasecompareTocompareToBytescompareToCodePoints
compareToIgnoreCasecompareToBytesIgnoreCasecompareToCodePointsIgnoreCase
escapeForHtmlnormalizeLineEndingsreverseacronym
Checking the length of a string
Creating instances from all entries in an array
Contributing
All contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed.
License
This project is licensed under the terms of the MIT License.
All versions of str with dependencies
ext-mbstring Version *