PS
in package
An Approximation of a Python String in PHP
Table of Contents
Properties
- $internal : mixed
Methods
- __construct() : mixed
- __toString() : mixed
- endsWith() : mixed
- find() : mixed
- get() : mixed
- len() : mixed
- lower() : mixed
- replace() : mixed
- rfind() : mixed
- s() : mixed
- set() : mixed
- slice() : mixed
- split() : mixed
- emulate the Python split()
- startsWith() : mixed
- strip() : mixed
- emulate python strip()
- upper() : mixed
Properties
$internal
public
mixed
$internal
= ''
Methods
__construct()
public
__construct([mixed $str = false ]) : mixed
Parameters
- $str : mixed = false
__toString()
public
__toString() : mixed
endsWith()
public
endsWith(mixed $needle) : mixed
Parameters
- $needle : mixed
find()
public
find(mixed $sub[, mixed $start = 0 ][, mixed $end = -1 ]) : mixed
Parameters
- $sub : mixed
- $start : mixed = 0
- $end : mixed = -1
get()
public
get() : mixed
len()
public
len() : mixed
lower()
public
lower() : mixed
replace()
public
replace(mixed $search, mixed $replace) : mixed
Parameters
- $search : mixed
- $replace : mixed
rfind()
public
rfind(mixed $sub[, mixed $start = 0 ][, mixed $end = -1 ]) : mixed
Parameters
- $sub : mixed
- $start : mixed = 0
- $end : mixed = -1
s()
public
static s([mixed $str = false ]) : mixed
Parameters
- $str : mixed = false
set()
public
set([mixed $str = false ]) : mixed
Parameters
- $str : mixed = false
slice()
public
slice([mixed $start = 0 ][, mixed $end = -1 ]) : mixed
Parameters
- $start : mixed = 0
- $end : mixed = -1
split()
emulate the Python split()
public
split([mixed $separator = false ][, mixed $maxsplit = false ]) : mixed
string.split(separator, maxsplit)
separator Optional. Specifies the separator to use when splitting the string. By default any whitespace is a separator maxsplit Optional. Specifies how many splits to do. Default value is -1, which is "all occurrences"
Note: When maxsplit is specified, the list will contain the specified number of elements plus one.
Parameters
- $separator : mixed = false
- $maxsplit : mixed = false
startsWith()
public
startsWith(mixed $needle) : mixed
Parameters
- $needle : mixed
strip()
emulate python strip()
public
strip([mixed $characters = false ]) : mixed
string.strip(characters)
characters Optional. A set of characters to remove as leading/trailing characters
txt = ",,,,,rrttgg.....banana....rrr" x = txt.strip(",.grt")
Parameters
- $characters : mixed = false
upper()
public
upper() : mixed