Represents a string of abstract characters.
Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). This class is the abstract type to use as a type-hint when the logic you want to implement doesn't care about the exact variant it deals with.
- author Nicolas Grekas
- author Hugo Hamon
- throws \ExceptionInterface
Abstract
- Children
- Implements
JsonSerializable Stringable
| Constants |
| public Symfony |
| public Symfony |
| public Symfony |
| public Symfony |
| public Symfony |
| public Symfony |
| public Symfony |
| public Symfony |
| Methods |
| public __clone() |
| public abstract __construct(string $string = '') |
| public __sleep() : array |
| public __toString() : string |
public after(Traversable|array|string $needle, bool $includeNeedle = false, int $offset = 0) : static
|
public afterLast(Traversable|array|string $needle, bool $includeNeedle = false, int $offset = 0) : static
|
| public abstract append(string $suffix) : static |
public before(Traversable|array|string $needle, bool $includeNeedle = false, int $offset = 0) : static
|
public beforeLast(Traversable|array|string $needle, bool $includeNeedle = false, int $offset = 0) : static
|
public bytesAt(int $offset) : array
|
| public abstract camel() : static |
public abstract chunk(int $length = 1) : array
|
| public collapseWhitespace() : static |
public containsAny(Traversable|array|string $needle) : bool
|
public endsWith(Traversable|array|string $suffix) : bool
|
| public ensureEnd(string $suffix) : static |
| public ensureStart(string $prefix) : static |
public equalsTo(Traversable|array|string $string) : bool
|
| public abstract folded() : static |
| public ignoreCase() : static |
public indexOf(Traversable|array|string $needle, int $offset = 0) : ?int
|
public indexOfLast(Traversable|array|string $needle, int $offset = 0) : ?int
|
| public isEmpty() : bool |
| public abstract join(array $strings, ?string $lastGlue = NULL) : static |
| public jsonSerialize() : string |
| public kebab() : static |
| public abstract length() : int |
| public abstract lower() : static |
| public abstract match(string $regexp, int $flags = 0, int $offset = 0) : array Matches the string using a regular expression. Pass PREG_PATTERN_ORDER or PREG_SET_ORDER as $flags to get all occurrences matching the regular expression.
|
| public abstract padBoth(int $length, string $padStr = ' ') : static |
| public abstract padEnd(int $length, string $padStr = ' ') : static |
| public abstract padStart(int $length, string $padStr = ' ') : static |
| public pascal() : static |
| public abstract prepend(string $prefix) : static |
| public repeat(int $multiplier) : static |
| public abstract replace(string $from, string $to) : static |
| public abstract replaceMatches(string $fromRegexp, callable|string $to) : static |
| public abstract reverse() : static |
| public abstract slice(int $start = 0, ?int $length = NULL) : static |
| public abstract snake() : static |
| public abstract splice(string $replacement, int $start = 0, ?int $length = NULL) : static |
public split(string $delimiter, ?int $limit = NULL, ?int $flags = NULL) : array
|
public startsWith(Traversable|array|string $prefix) : bool
|
| public abstract title(bool $allWords = false) : static |
| public toByteString(?string $toEncoding = NULL) : Symfony |
| public toCodePointString() : Symfony |
| public toString() : string |
| public toUnicodeString() : Symfony |
| public abstract trim(string $chars = '  ') : static |
| public abstract trimEnd(string $chars = '  ') : static |
public trimPrefix( $prefix) : static
|
| public abstract trimStart(string $chars = '  ') : static |
public trimSuffix( $suffix) : static
|
| public truncate(int $length, string $ellipsis = '', Symfony |
| public static unwrap(array $values) : array Unwraps instances of AbstractString back to strings.
|
| public abstract upper() : static |
| public abstract width(bool $ignoreAnsiDecoration = true) : int Returns the printable length on a terminal. |
| public wordwrap(int $width = 75, string $break = ' ', bool $cut = false) : static |
| public static wrap(array $values) : array Wraps (and normalizes) strings in instances of AbstractString.
|
| Properties |
| protected ?bool $ignoreCase = false |
| protected string $string = '' |
| Methods |
| public static unwrap(array $values) : array Unwraps instances of AbstractString back to strings.
|
| public static wrap(array $values) : array Wraps (and normalizes) strings in instances of AbstractString.
|