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
startsWith
startsWithBytes
startsWithCodePoints
startsWithIgnoreCase
startsWithBytesIgnoreCase
startsWithCodePointsIgnoreCase
contains
containsBytes
containsCodePoints
containsIgnoreCase
containsBytesIgnoreCase
containsCodePointsIgnoreCase
endsWith
endsWithBytes
endsWithCodePoints
endsWithIgnoreCase
endsWithBytesIgnoreCase
endsWithCodePointsIgnoreCase
trim
trimStart
trimEnd
first
firstBytes
firstCodePoints
last
lastBytes
lastCodePoints
byteAt
codePointAt
isEmpty
isAscii
isPrintableAscii
toLowerCase
toLowerCaseBytes
toLowerCaseCodePoints
isLowerCase
toUpperCase
toUpperCaseBytes
toUpperCaseCodePoints
isUpperCase
isCapitalized
truncate
truncateBytes
truncateCodePoints
truncateSafely
truncateBytesSafely
truncateCodePointsSafely
count
countBytes
countCodePoints
length
lengthInBytes
lengthInCodePoints
cutStart
cutBytesAtStart
cutCodePointsAtStart
cutEnd
cutBytesAtEnd
cutCodePointsAtEnd
replace
replaceBytes
replaceCodePoints
replaceIgnoreCase
replaceBytesIgnoreCase
replaceCodePointsIgnoreCase
replaceFirst
replaceFirstBytes
replaceFirstCodePoints
replaceFirstIgnoreCase
replaceFirstBytesIgnoreCase
replaceFirstCodePointsIgnoreCase
replacePrefix
replacePrefixBytes
replacePrefixCodePoints
replaceLast
replaceLastBytes
replaceLastCodePoints
replaceLastIgnoreCase
replaceLastBytesIgnoreCase
replaceLastCodePointsIgnoreCase
replaceSuffix
replaceSuffixBytes
replaceSuffixCodePoints
split
splitBytes
splitCodePoints
splitByRegex
words
beforeFirst
beforeFirstBytes
beforeFirstCodePoints
beforeLast
beforeLastBytes
beforeLastCodePoints
between
betweenBytes
betweenCodePoints
afterFirst
afterFirstBytes
afterFirstCodePoints
afterLast
afterLastBytes
afterLastCodePoints
matches
equals
equalsIgnoreCase
compareTo
compareToBytes
compareToCodePoints
compareToIgnoreCase
compareToBytesIgnoreCase
compareToCodePointsIgnoreCase
escapeForHtml
normalizeLineEndings
reverse
acronym
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 *