Calls the given string function. If a multibyte version exists this is used.
Because a static method can not use $this->string this must be given through a parameter.
The function name is required. If parameters are needed these are passed in an array except the first parameter, because this is always the string itself and is not needed.
Usage:
Adds the given string to the existing string.
The given string can either be a normal string or a String object. This applies also to the delimiter.
To delimit the given string from the existing one you can use another string or one of the String::CONTROL_CHAR_ constants. You can also combine some of these constants, e.g. String::CONTROL_CHAR_CARRIAGE_RETURN . String::CONTROL_CHAR_LINEFEED
To define the position of the new string use the class constants String::STRING_BEFORE or String::STRING_AFTER. The default position is after the existing string.
Usage:
With this you can add an array of strings.
The given strings can either be a normal string or a String object. This applies also to the delimiter.
To delimit the given strings from the existing one you can use another string or one of the String::CONTROL_CHAR_ constants. You can also combine some of these constants, e.g. String::CONTROL_CHAR_CARRIAGE_RETURN . String::CONTROL_CHAR_LINEFEED
To define the position of the new strings use the class constants String::STRING_BEFORE or String::STRING_AFTER. The default position is after the existing string.
Usage:
$newString = new String('This is a new string object.');
$string->addMore(array($newString, 'This string will be positioned even before the first string of this array.'), String::CONTROL_CHAR_LINEFEED, String::STRING_BEFORE);
Calls the given string function. If a multibyte version exists this is used.
The function name is required. If parameters are needed these are passed in an array except the first parameter, because this is always the string itself and is not needed.
Usage:
To insert a string into an existing one use this method.
To insert a string into an existing one use this method.
The given string can either be a normal string or a string object. The offset has to be an integer.
Usage:
To insert an array of string into an existing one use this method.
To insert an array of string into an existing one use this method.
The given strings can either be a normal string or string objects. The offset has to be an integer.
Usage:
This magic method will be used if the used method does not actually exist.
This magic method will be used if the used method does not actually exist.
The big clue with this method is that it delegates the used method name and its parameters to $this->edit(), which then tries to execute the string function. So it is possible to directly use some string functions, e.g. substr(). The example below shows how this could be used.
Usage:
This magic method will be used if a script tries to cast this object into a normal string.
This magic method will be used if a script tries to cast this object into a normal string.
Normally a warning of the type E_RECOVERABLE_ERROR would be thrown. But with this method the string will be returned.
Usage: