Documentation

Str implements StrContract

Interfaces, Classes and Traits

StrContract

Table of Contents

concat()  : bool
Concat the strings.
ConvertCase()  : string
Change case of character to opposite case.
count()  : int
Count the string.
hasLowerCase()  : bool
Check if string has atleast one lowercase.
hasUpperCase()  : bool
Check if string has atleast one uppercase.
isBase64()  : bool
Check if the input string is valid base64.
repeat()  : string
Repeats string $amount|1 times.
reverse()  : string
Reverse the string.
shuffle()  : string
Randomly shuffles the given string.
slice()  : bool|string
extracts a section of a string.
stripWhitespaces()  : string
Strip whitespace (or other characters) from the beginning and end of a string.
substring()  : bool|string
Return part of a string.
encoding()  : string
Get the encoding.

Methods

concat()

Concat the strings.

public static concat(string $g, string ...$str) : bool
Parameters
$g : string

With concat.

$str : string

String to concat.

Tags
since
1.0.0
Return values
bool

ConvertCase()

Change case of character to opposite case.

public static ConvertCase(string $str[, string $encoding = null ]) : string
Parameters
$str : string

String to be changed.

$encoding : string = null

Valid encoding.

Return values
string

count()

Count the string.

public static count(string $str[, string $encoding = null ]) : int
Parameters
$str : string

String to be counted.

$encoding : string = null

Valid encoding.

Tags
since
1.0.0
Return values
int

hasLowerCase()

Check if string has atleast one lowercase.

public static hasLowerCase(string $str[, string|null $encoding = null ]) : bool
Parameters
$str : string

String to be checked.

$encoding : string|null = null

Valid encoding.

Return values
bool

hasUpperCase()

Check if string has atleast one uppercase.

public static hasUpperCase(string $str[, string|null $encoding = null ]) : bool
Parameters
$str : string

String to be checked.

$encoding : string|null = null

Valid encoding.

Return values
bool

isBase64()

Check if the input string is valid base64.

public static isBase64(string $string) : bool
Parameters
$string : string

String to be tested

Return values
bool

repeat()

Repeats string $amount|1 times.

public static repeat(string $string[, int $amount = 1 ]) : string
Parameters
$string : string
$amount : int = 1
Return values
string

reverse()

Reverse the string.

public static reverse(string $str[, string $encoding = null ]) : string
Parameters
$str : string

String to be evaluated.

$encoding : string = null

Valid encoding.

Tags
since
1.0.0
Return values
string

shuffle()

Randomly shuffles the given string.

public static shuffle(string $string) : string
Parameters
$string : string
Return values
string

slice()

extracts a section of a string.

public static slice(string $string, int $start[, int|null $length = null ]) : bool|string
Parameters
$string : string

String to extract section from

$start : int

Start position

$length : int|null = null

Length of extraction

Return values
bool|string

stripWhitespaces()

Strip whitespace (or other characters) from the beginning and end of a string.

public static stripWhitespaces(string $string) : string
Parameters
$string : string
Return values
string

substring()

Return part of a string.

public static substring(string $str, int $start[, int|null $length = null ][, string $encoding = 'UTF-8' ]) : bool|string
Parameters
$str : string

input string to process

$start : int

Start position

$length : int|null = null

Length

$encoding : string = 'UTF-8'

optional encoding to use

Return values
bool|string

encoding()

Get the encoding.

private static encoding([string $encoding = null ]) : string
Parameters
$encoding : string = null

Valid encoding.

Tags
since
1.0.0
Return values
string

Search results