PS
class PS
An Approximation of a Python String in PHP
Properties
$internal |
Methods
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
emulate python strip()
emulate the Python split()
Details
at line 13
__construct($str = false)
at line 17
set($str = false)
at line 25
static
s($str = false)
at line 30
__toString()
at line 34
get()
at line 39
startsWith($needle)
at line 44
endsWith($needle)
at line 49
len()
at line 54
slice($start = 0, $end = -1)
at line 60
replace($search, $replace)
at line 64
lower()
at line 68
upper()
at line 72
find($sub, $start = 0, $end = -1)
at line 83
rfind($sub, $start = 0, $end = -1)
at line 102
strip($characters = false)
emulate python strip()
string.strip(characters)
characters Optional. A set of characters to remove as leading/trailing characters
txt = ",,,,,rrttgg.....banana....rrr" x = txt.strip(",.grt")
at line 117
split($separator = false, $maxsplit = false)
emulate the Python split()
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.