class OmniString

Represents a multibyte string and perform operations with the grapheme library for UTF-8 encoding, and mbstring for other encodings.

Traits

Methods

string
getEncoding()

No description

setEncoding(string $encoding)

No description

__construct(string $value = '', string $encoding = '')

No description

string
__toString()

No description

string
pad(int $padLength = 0, string $padString = ' ', int $padType = STR_PAD_RIGHT)

No description

bool
startsWith(string $start)

No description

bool
endsWith(string $end)

No description

int
len() deprecated

No description

int
countBytes()

No description

int
countCodePoints()

No description

int
countGraphemes()

No description

array
getBytes()

No description

array
getCodePoints()

No description

array
getGraphemes()

No description

array
getChars() deprecated

No description

array
getBigrams()

No description

explode(string $delimiter, int $limit = PHP_INT_MAX)

No description

string
getValue()

No description

void
setValue(string $value)

No description

Details

in WithEncoding at line 15
string getEncoding()

No description

Return Value

string

in WithEncoding at line 19
WithEncoding setEncoding(string $encoding)

No description

Parameters

string $encoding

Return Value

WithEncoding

at line 26
__construct(string $value = '', string $encoding = '')

No description

Parameters

string $value
string $encoding

at line 35
string __toString()

No description

Return Value

string

at line 43
string pad(int $padLength = 0, string $padString = ' ', int $padType = STR_PAD_RIGHT)

No description

Parameters

int $padLength
string $padString
int $padType

Return Value

string

at line 57
bool startsWith(string $start)

No description

Parameters

string $start

Return Value

bool

at line 61
bool endsWith(string $end)

No description

Parameters

string $end

Return Value

bool

at line 69
int len() deprecated

deprecated Use more specific method to express your intent: countBytes, countCodePoints or countGraphemes

No description

Return Value

int

at line 73
int countBytes()

No description

Return Value

int

at line 77
int countCodePoints()

No description

Return Value

int

at line 81
int countGraphemes()

No description

Return Value

int

at line 88
array getBytes()

No description

Return Value

array

at line 92
array getCodePoints()

No description

Return Value

array

at line 96
array getGraphemes()

No description

Return Value

array

at line 115
array getChars() deprecated

deprecated Use more specific method to express your intent: getBytes, getCodePoints or getGraphemes

No description

Return Value

array

at line 119
array getBigrams()

No description

Return Value

array

at line 152
Vector explode(string $delimiter, int $limit = PHP_INT_MAX)

No description

Parameters

string $delimiter
int $limit

Return Value

Vector

at line 172
string getValue()

No description

Return Value

string

at line 179
void setValue(string $value)

No description

Parameters

string $value

Return Value

void