Skip to content

Latest commit

 

History

History
1992 lines (717 loc) · 17.5 KB

CodePointString.md

File metadata and controls

1992 lines (717 loc) · 17.5 KB
*** # CodePointString Represents a string of Unicode code points encoded as UTF-8. * Full name: `\Symfony\Component\String\CodePointString` * Parent class: [`\Symfony\Component\String\AbstractUnicodeString`](./AbstractUnicodeString.md) ## Methods ### __construct ```php public __construct(string $string = ''): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$string` | **string** | | *** ### append ```php public append(string $suffix): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$suffix` | **string** | | *** ### chunk ```php public chunk(int $length = 1): array ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$length` | **int** | | *** ### codePointsAt ```php public codePointsAt(int $offset): int[] ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$offset` | **int** | | *** ### endsWith ```php public endsWith(string|iterable|\Symfony\Component\String\AbstractString $suffix): bool ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$suffix` | **string|iterable|\Symfony\Component\String\AbstractString** | | *** ### equalsTo ```php public equalsTo(string|iterable|\Symfony\Component\String\AbstractString $string): bool ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$string` | **string|iterable|\Symfony\Component\String\AbstractString** | | *** ### indexOf ```php public indexOf(string|iterable|\Symfony\Component\String\AbstractString $needle, int $offset): ?int ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$needle` | **string|iterable|\Symfony\Component\String\AbstractString** | | | `$offset` | **int** | | *** ### indexOfLast ```php public indexOfLast(string|iterable|\Symfony\Component\String\AbstractString $needle, int $offset): ?int ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$needle` | **string|iterable|\Symfony\Component\String\AbstractString** | | | `$offset` | **int** | | *** ### length ```php public length(): int ``` *** ### prepend ```php public prepend(string $prefix): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$prefix` | **string** | | *** ### replace ```php public replace(string $from, string $to): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$from` | **string** | | | `$to` | **string** | | *** ### slice ```php public slice(int $start, int $length = null): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$start` | **int** | | | `$length` | **int** | | *** ### splice ```php public splice(string $replacement, int $start, int $length = null): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$replacement` | **string** | | | `$start` | **int** | | | `$length` | **int** | | *** ### split ```php public split(string $delimiter, int $limit = null, int $flags = null): array ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$delimiter` | **string** | | | `$limit` | **int** | | | `$flags` | **int** | | *** ### startsWith ```php public startsWith(string|iterable|\Symfony\Component\String\AbstractString $prefix): bool ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$prefix` | **string|iterable|\Symfony\Component\String\AbstractString** | | *** ## Inherited methods ### fromCodePoints ```php public static fromCodePoints(int $codes): static ``` * This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$codes` | **int** | | *** ### ascii Generic UTF-8 to ASCII transliteration. ```php public ascii(string[]|\Transliterator[]|\Closure[] $rules = []): self ``` Install the intl extension for best results. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$rules` | **string[]|\Transliterator[]|\Closure[]** | See "*-Latin" rules from Transliterator::listIDs() | *** ### camel ```php public camel(): static ``` * This method is **abstract**. *** ### codePointsAt ```php public codePointsAt(int $offset): int[] ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$offset` | **int** | | *** ### folded ```php public folded(): static ``` * This method is **abstract**. *** ### join ```php public join(array $strings, string $lastGlue = null): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$strings` | **array** | | | `$lastGlue` | **string** | | *** ### lower ```php public lower(): static ``` * This method is **abstract**. *** ### match Matches the string using a regular expression. ```php public match(string $regexp, int $flags, int $offset): array ``` Pass PREG_PATTERN_ORDER or PREG_SET_ORDER as $flags to get all occurrences matching the regular expression. * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$regexp` | **string** | | | `$flags` | **int** | | | `$offset` | **int** | | **Return Value:** All matches in a multi-dimensional array ordered according to flags *** ### normalize ```php public normalize(int $form = self::NFC): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$form` | **int** | | *** ### padBoth ```php public padBoth(int $length, string $padStr = ' '): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$length` | **int** | | | `$padStr` | **string** | | *** ### padEnd ```php public padEnd(int $length, string $padStr = ' '): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$length` | **int** | | | `$padStr` | **string** | | *** ### padStart ```php public padStart(int $length, string $padStr = ' '): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$length` | **int** | | | `$padStr` | **string** | | *** ### replaceMatches ```php public replaceMatches(string $fromRegexp, string|callable $to): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$fromRegexp` | **string** | | | `$to` | **string|callable** | | *** ### reverse ```php public reverse(): static ``` * This method is **abstract**. *** ### snake ```php public snake(): static ``` * This method is **abstract**. *** ### title ```php public title(bool $allWords = false): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$allWords` | **bool** | | *** ### trim ```php public trim(string $chars = " �  "): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$chars` | **string** | | *** ### trimEnd ```php public trimEnd(string $chars = " �  "): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$chars` | **string** | | *** ### trimPrefix ```php public trimPrefix(string|string[] $prefix): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$prefix` | **string|string[]** | | *** ### trimStart ```php public trimStart(string $chars = " �  "): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$chars` | **string** | | *** ### trimSuffix ```php public trimSuffix(string|string[] $suffix): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$suffix` | **string|string[]** | | *** ### upper ```php public upper(): static ``` * This method is **abstract**. *** ### width Returns the printable length on a terminal. ```php public width(bool $ignoreAnsiDecoration = true): int ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$ignoreAnsiDecoration` | **bool** | | *** ### pad ```php private pad(int $len, self $pad, int $type): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$len` | **int** | | | `$pad` | **self** | | | `$type` | **int** | | *** ### wcswidth Based on https://github.com/jquast/wcwidth, a Python implementation of https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c. ```php private wcswidth(string $string): int ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$string` | **string** | | *** ### __construct ```php public __construct(string $string = ''): mixed ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$string` | **string** | | *** ### unwrap Unwraps instances of AbstractString back to strings. ```php public static unwrap(array $values): string[]|array ``` * This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$values` | **array** | | *** ### wrap Wraps (and normalizes) strings in instances of AbstractString. ```php public static wrap(array $values): static[]|array ``` * This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$values` | **array** | | *** ### after ```php public after(string|string[] $needle, bool $includeNeedle = false, int $offset): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$needle` | **string|string[]** | | | `$includeNeedle` | **bool** | | | `$offset` | **int** | | *** ### afterLast ```php public afterLast(string|string[] $needle, bool $includeNeedle = false, int $offset): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$needle` | **string|string[]** | | | `$includeNeedle` | **bool** | | | `$offset` | **int** | | *** ### append ```php public append(string $suffix): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$suffix` | **string** | | *** ### before ```php public before(string|string[] $needle, bool $includeNeedle = false, int $offset): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$needle` | **string|string[]** | | | `$includeNeedle` | **bool** | | | `$offset` | **int** | | *** ### beforeLast ```php public beforeLast(string|string[] $needle, bool $includeNeedle = false, int $offset): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$needle` | **string|string[]** | | | `$includeNeedle` | **bool** | | | `$offset` | **int** | | *** ### bytesAt ```php public bytesAt(int $offset): int[] ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$offset` | **int** | | *** ### chunk ```php public chunk(int $length = 1): static[] ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$length` | **int** | | *** ### collapseWhitespace ```php public collapseWhitespace(): static ``` *** ### containsAny ```php public containsAny(string|string[] $needle): bool ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$needle` | **string|string[]** | | *** ### endsWith ```php public endsWith(string|string[] $suffix): bool ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$suffix` | **string|string[]** | | *** ### ensureEnd ```php public ensureEnd(string $suffix): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$suffix` | **string** | | *** ### ensureStart ```php public ensureStart(string $prefix): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$prefix` | **string** | | *** ### equalsTo ```php public equalsTo(string|string[] $string): bool ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$string` | **string|string[]** | | *** ### ignoreCase ```php public ignoreCase(): static ``` *** ### indexOf ```php public indexOf(string|string[] $needle, int $offset): ?int ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$needle` | **string|string[]** | | | `$offset` | **int** | | *** ### indexOfLast ```php public indexOfLast(string|string[] $needle, int $offset): ?int ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$needle` | **string|string[]** | | | `$offset` | **int** | | *** ### isEmpty ```php public isEmpty(): bool ``` *** ### jsonSerialize ```php public jsonSerialize(): string ``` *** ### length ```php public length(): int ``` * This method is **abstract**. *** ### prepend ```php public prepend(string $prefix): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$prefix` | **string** | | *** ### repeat ```php public repeat(int $multiplier): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$multiplier` | **int** | | *** ### replace ```php public replace(string $from, string $to): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$from` | **string** | | | `$to` | **string** | | *** ### slice ```php public slice(int $start, int $length = null): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$start` | **int** | | | `$length` | **int** | | *** ### splice ```php public splice(string $replacement, int $start, int $length = null): static ``` * This method is **abstract**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$replacement` | **string** | | | `$start` | **int** | | | `$length` | **int** | | *** ### split ```php public split(string $delimiter, int $limit = null, int $flags = null): static[] ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$delimiter` | **string** | | | `$limit` | **int** | | | `$flags` | **int** | | *** ### startsWith ```php public startsWith(string|string[] $prefix): bool ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$prefix` | **string|string[]** | | *** ### toByteString ```php public toByteString(string $toEncoding = null): \Symfony\Component\String\ByteString ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$toEncoding` | **string** | | *** ### toCodePointString ```php public toCodePointString(): \Symfony\Component\String\CodePointString ``` *** ### toString ```php public toString(): string ``` *** ### toUnicodeString ```php public toUnicodeString(): \Symfony\Component\String\UnicodeString ``` *** ### truncate ```php public truncate(int $length, string $ellipsis = '', bool $cut = true): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$length` | **int** | | | `$ellipsis` | **string** | | | `$cut` | **bool** | | *** ### wordwrap ```php public wordwrap(int $width = 75, string $break = " ", bool $cut = false): static ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$width` | **int** | | | `$break` | **string** | | | `$cut` | **bool** | | *** ### __sleep ```php public __sleep(): array ``` *** ### __clone ```php public __clone(): mixed ``` *** ### __toString ```php public __toString(): string ``` *** ***