Str
in package
implements
Stringable, IteratorAggregate, FromIterator, TryFromIterator
Immutable UTF-8 string wrapper.
Tags
Table of Contents
Interfaces
- Stringable
- IteratorAggregate
- FromIterator
- TryFromIterator
Properties
- $str : string
Methods
- __toString() : string
- byteChars() : Iter<int, string>
- byteCount() : int
- bytes() : Iter<int, int>
- chars() : Iter<int, string>
- codepoints() : Iter
- fromChars() : Str
- fromIterator() : Impl
- getIterator() : Traversable
- length() : int
- of() : Str
- tryFromIterator() : Result
- unwrap() : string
- __construct() : mixed
Properties
$str read-only
protected
string
$str
Methods
__toString()
public
__toString() : string
Tags
Return values
stringbyteChars()
public
byteChars() : Iter<int, string>
Return values
Iter<int, string>byteCount()
public
byteCount() : int
Return values
intbytes()
public
bytes() : Iter<int, int>
Return values
Iter<int, int>chars()
public
chars() : Iter<int, string>
Return values
Iter<int, string>codepoints()
public
codepoints() : Iter
Return values
IterfromChars()
public
static fromChars(iterable<string|int, string> $chars) : Str
Parameters
- $chars : iterable<string|int, string>
Tags
Return values
StrfromIterator()
public
static fromIterator(Iterator $iterator) : Impl
Parameters
- $iterator : Iterator
Return values
ImplgetIterator()
public
getIterator() : Traversable
Tags
Return values
Traversablelength()
public
length() : int
Return values
intof()
public
static of(string $str) : Str
Parameters
- $str : string
Return values
StrtryFromIterator()
public
static tryFromIterator(Iterator $iterator) : Result
Parameters
- $iterator : Iterator
Tags
Return values
Resultunwrap()
public
unwrap() : string
Return values
string__construct()
protected
__construct(string $str) : mixed
Parameters
- $str : string