Download the PHP package mscribellito/str without Composer

On this page you can find all versions of the php package mscribellito/str. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package str

Latest Version on Packagist Total Downloads

What is Str?

Str is an immutable PHP class that provides convenient, object-oriented operations for string handling and manipulation. Str provides methods for examining individual characters of the string, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase. A Str is immutable (constant) and its value cannot be changed after creation.

Note: Str is not intended to replace all instances of your string variables - just those of which require many string operations and can benefit from an easy to use API.

Requirements

PHP version 7 or newer is required.

Installing

Install via Composer:

Require:

Example Usage

You can also create an instance of Str via a convenient, helper function:

Chaining

Constructor Summary

Constructor and Description
Str()
Initializes a newly created Str object so that it represents an empty character sequence.
Str(mixed $original)
Initializes a newly created Str object so that it represents the same sequence of characters as the argument; in other words, the newly created string is a copy of the argument string.
Str(mixed $original, int $offset, int $count)
Initializes a newly created Str object so that it contains characters from a substring of the argument string.

Method Summary

Modifier and Type Method and Description
string __toString()
The value of this string is returned.
string charAt(int $index)
Returns the character at the specified index.
int charCodeAt(int $index)
Returns the character ASCII value at the specified index.
int compareTo(string $str)
Compares two strings lexicographically.
int compareToIgnoreCase(string $str)
Compares two strings lexicographically, ignoring case differences.
Str concat()
Concatenates the specified string(s) to the end of this string.
bool contains(string $str)
Returns true if and only if this string contains the specified string.
bool endsWith(string $suffix)
Tests if this string ends with the specified suffix.
bool equals(string $str)
Compares this string to the specified string.
bool equalsIgnoreCase(string $str)
Compares this string to the specified string, ignoring case considerations.
static Str format(string $format)
Returns a formatted string using the specified format string and arguments.
int indexOf(string $str, [int $fromIndex=0])
Returns the index within this string of the first occurrence of the specified string, optionally starting the search at the specified index.
bool isEmpty()
Returns true if and only if length() is 0.
static Str join(string $delimiter, mixed[] $elements)
Returns a new string composed of array elements joined together with the specified delimiter.
int lastIndexOf(string $str, [int $fromIndex=0])
Returns the index within this string of the last occurrence of the specified character, optionally starting the search at the specified index.
int length()
Returns the length of this string.
bool matches(string $regex)
Tells whether or not this string matches the given regular expression.
bool regionMatches(int $toffset, string $str, int $ooffset, int $length, [bool $ignoreCase=false])
Tests if two string regions are equal.
Str replace(string $target, string $replacement)
Returns a string resulting from replacing all occurrences of target in this string with replacement.
Str replaceAll(string $regex, string $replacement)
Replaces each substring of this string that matches the given regular expression with the given replacement.
Str replaceFirst(string $regex, string $replacement)
Replaces the first substring of this string that matches the given regular expression with the given replacement.
Str[] split(string $regex, [int $limit=null])
Splits this string around matches of the given regular expression.
bool startsWith(string $prefix, [int $toffset=0])
Tests if this string starts with the specified prefix, optionally starting the search at the specified index.
Str substring(int $beginIndex, [int $endIndex=null])
Returns a string that is a substring of this string.
string[] toCharArray()
Converts this string to a new character array.
Str toLowerCase()
Converts all of the characters in this string to lower case.
Str toUpperCase()
Converts all of the characters in this string to upper case.
Str trim([string $characterMask=" \t\n\r\0\x0B"])
Returns a string whose value is this string, with any leading and trailing whitespace removed.

Testing

Run tests with vendor/bin/phpunit

License

Released under the MIT License. See LICENSE for details.


All versions of str with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mscribellito/str contains the following files

Loading the files please wait ....