public class PyString extends PyBaseString implements BufferProtocol
PyObject.ConversionException
Modifier and Type | Field and Description |
---|---|
static PyType |
TYPE |
gcMonitorGlobal
Constructor and Description |
---|
PyString() |
PyString(char c) |
PyString(PyType subType,
String string)
Fundamental constructor for
PyString objects when the client provides a Java
String , necessitating that we range check the characters. |
PyString(String string) |
Modifier and Type | Method and Description |
---|---|
PyObject |
__add__(PyObject other)
Equivalent to the standard Python __add__ method.
|
int |
__cmp__(PyObject other)
Equivalent to the standard Python __cmp__ method.
|
PyComplex |
__complex__()
Equivalent to the standard Python __complex__ method.
|
boolean |
__contains__(PyObject o)
Equivalent to the standard Python __contains__ method.
|
PyObject |
__eq__(PyObject other)
Equivalent to the standard Python __eq__ method.
|
PyFloat |
__float__()
Equivalent to the standard Python __float__ method.
|
PyObject |
__format__(PyObject formatSpec) |
PyObject |
__ge__(PyObject other)
Equivalent to the standard Python __ge__ method.
|
PyTuple |
__getnewargs__() |
PyObject |
__gt__(PyObject other)
Equivalent to the standard Python __gt__ method.
|
PyObject |
__int__()
Equivalent to the standard Python __int__ method.
|
PyObject |
__invert__()
Equivalent to the standard Python __invert__ method.
|
PyObject |
__le__(PyObject other)
Equivalent to the standard Python __le__ method.
|
int |
__len__()
Equivalent to the standard Python __len__ method.
|
PyObject |
__long__()
Equivalent to the standard Python __long__ method.
|
PyObject |
__lt__(PyObject other)
Equivalent to the standard Python __lt__ method.
|
PyObject |
__mod__(PyObject other)
Equivalent to the standard Python __mod__ method
|
PyObject |
__mul__(PyObject o)
Equivalent to the standard Python __mul__ method.
|
PyObject |
__ne__(PyObject other)
Equivalent to the standard Python __ne__ method.
|
PyObject |
__neg__()
Equivalent to the standard Python __neg__ method.
|
PyObject |
__pos__()
Equivalent to the standard Python __pos__ method.
|
PyString |
__repr__()
Equivalent to the standard Python __repr__ method.
|
PyObject |
__rmul__(PyObject o)
Equivalent to the standard Python __rmul__ method.
|
PyString |
__str__()
Equivalent to the standard Python __str__ method.
|
Object |
__tojava__(Class<?> c)
Equivalent to the Jython __tojava__ method.
|
PyUnicode |
__unicode__() |
double |
asDouble()
Convert this object into a double.
|
int |
asInt()
Convert this object into an int.
|
long |
asLong()
Convert this object longo an long.
|
String |
asName(int index) |
String |
asString() |
String |
asString(int index) |
double |
atof()
Convert this PyString to a floating-point value according to Python rules.
|
int |
atoi() |
int |
atoi(int base) |
PyLong |
atol() |
PyLong |
atol(int base) |
String |
capitalize() |
String |
center(int width) |
int |
count(PyObject sub)
Return the number of non-overlapping occurrences of substring
sub . |
int |
count(PyObject sub,
PyObject start)
Return the number of non-overlapping occurrences of substring
sub in the range
[start:] . |
int |
count(PyObject sub,
PyObject start,
PyObject end)
Return the number of non-overlapping occurrences of substring
sub in the range
[start:end] . |
int |
count(String sub)
Equivalent to
count(PyObject) specialized to String . |
int |
count(String sub,
PyObject start)
Equivalent to
count(PyObject, PyObject) specialized to String . |
int |
count(String sub,
PyObject start,
PyObject end)
Equivalent to
count(PyObject, PyObject, PyObject) specialized to String
. |
PyString |
createInstance(String str)
Create an instance of the same type as this object, from the Java String given as argument.
|
static String |
decode_UnicodeEscape(String str,
int start,
int end,
String errors,
boolean unicode) |
PyObject |
decode() |
PyObject |
decode(String encoding) |
PyObject |
decode(String encoding,
String errors) |
static String |
encode_UnicodeEscape(String str,
boolean use_quotes) |
String |
encode() |
String |
encode(String encoding) |
String |
encode(String encoding,
String errors) |
boolean |
endswith(PyObject suffix)
Equivalent to the Python
str.endswith method, testing whether a string ends with
a specified suffix. |
boolean |
endswith(PyObject suffix,
PyObject start)
Equivalent to the Python
str.endswith method, testing whether a string ends with
a specified suffix, where a sub-range is specified by [start:] . |
boolean |
endswith(PyObject suffix,
PyObject start,
PyObject end)
Equivalent to the Python
str.endswith method, testing whether a string ends with
a specified suffix, where a sub-range is specified by [start:end] . |
String |
expandtabs() |
String |
expandtabs(int tabsize) |
int |
find(PyObject sub)
Return the lowest index in the string where substring
sub is found. |
int |
find(PyObject sub,
PyObject start)
Return the lowest index in the string where substring
sub is found, such that
sub is contained in the slice s[start:] . |
int |
find(PyObject sub,
PyObject start,
PyObject end)
Return the lowest index in the string where substring
sub is found, such that
sub is contained in the slice s[start:end] . |
int |
find(String sub)
Equivalent to
find(PyObject) specialized to String . |
int |
find(String sub,
PyObject start)
Equivalent to
find(PyObject, PyObject) specialized to String . |
int |
find(String sub,
PyObject start,
PyObject end)
Equivalent to
find(PyObject, PyObject, PyObject) specialized to String . |
static PyString |
fromInterned(String interned)
Creates a PyString from an already interned String.
|
PyBuffer |
getBuffer(int flags)
Return a read-only buffer view of the contents of the string, treating it as a sequence of
unsigned bytes.
|
int |
getInt(int i) |
String |
getString() |
int |
hashCode() |
int |
index(PyObject sub)
Return the lowest index in the string where substring
sub is found. |
int |
index(PyObject sub,
PyObject start)
Return the lowest index in the string where substring
sub is found, such that
sub is contained in the slice s[start:] . |
int |
index(PyObject sub,
PyObject start,
PyObject end)
Return the lowest index in the string where substring
sub is found, such that
sub is contained in the slice s[start:end] . |
int |
index(String sub)
Equivalent to
index(PyObject) specialized to String . |
int |
index(String sub,
PyObject start)
Equivalent to
index(PyObject, PyObject) specialized to String . |
int |
index(String sub,
PyObject start,
PyObject end)
Equivalent to
index(PyObject, PyObject, PyObject) specialized to String
. |
String |
internedString() |
boolean |
isalnum() |
boolean |
isalpha() |
boolean |
isBasicPlane()
Determine whether the string consists entirely of basic-plane characters.
|
boolean |
isdecimal() |
boolean |
isdigit() |
boolean |
islower() |
boolean |
isnumeric() |
boolean |
isspace() |
boolean |
istitle() |
boolean |
isunicode() |
boolean |
isupper() |
PyString |
join(PyObject seq) |
String |
ljust(int width) |
String |
ljust(int width,
String padding) |
String |
lower() |
String |
lstrip()
Equivalent of Python
str.lstrip() with no argument, meaning strip whitespace. |
PyObject |
lstrip(PyObject stripChars)
Equivalent of Python
str.lstrip() . |
String |
lstrip(String stripChars)
Equivalent of Python
str.lstrip() . |
PyTuple |
partition(PyObject sepObj)
Equivalent to Python
str.partition() , splits the PyString at the
first occurrence of sepObj returning a PyTuple containing the part
before the separator, the separator itself, and the part after the separator. |
PyString |
replace(PyObject oldPiece,
PyObject newPiece)
Equivalent to Python str.replace(old, new), returning a copy of the string with all
occurrences of substring old replaced by new.
|
PyString |
replace(PyObject oldPiece,
PyObject newPiece,
int count)
Equivalent to Python str.replace(old, new[, count]), returning a copy of the string with all
occurrences of substring old replaced by new.
|
int |
rfind(PyObject sub)
Return the highest index in the string where substring
sub is found. |
int |
rfind(PyObject sub,
PyObject start)
Return the highest index in the string where substring
sub is found, such that
sub is contained in the slice s[start:] . |
int |
rfind(PyObject sub,
PyObject start,
PyObject end)
Return the highest index in the string where substring
sub is found, such that
sub is contained in the slice s[start:end] . |
int |
rfind(String sub)
Equivalent to
find(PyObject) specialized to String . |
int |
rfind(String sub,
PyObject start)
Equivalent to
find(PyObject, PyObject) specialized to String . |
int |
rfind(String sub,
PyObject start,
PyObject end)
Equivalent to
find(PyObject, PyObject, PyObject) specialized to String . |
int |
rindex(PyObject sub)
Return the highest index in the string where substring
sub is found. |
int |
rindex(PyObject sub,
PyObject start)
Return the highest index in the string where substring
sub is found, such that
sub is contained in the slice s[start:] . |
int |
rindex(PyObject sub,
PyObject start,
PyObject end)
Return the highest index in the string where substring
sub is found, such that
sub is contained in the slice s[start:end] . |
int |
rindex(String sub)
Equivalent to
rindex(PyObject) specialized to String . |
int |
rindex(String sub,
PyObject start)
Equivalent to
rindex(PyObject, PyObject) specialized to String . |
int |
rindex(String sub,
PyObject start,
PyObject end)
Equivalent to
rindex(PyObject, PyObject, PyObject) specialized to
String . |
String |
rjust(int width) |
PyTuple |
rpartition(PyObject sepObj)
Equivalent to Python
str.rpartition() , splits the PyString at the
last occurrence of sepObj returning a PyTuple containing the part before
the separator, the separator itself, and the part after the separator. |
PyList |
rsplit()
Equivalent to Python
str.rsplit() , splitting on runs of whitespace. |
PyList |
rsplit(PyObject sep)
|
PyList |
rsplit(PyObject sep,
int maxsplit)
As
rsplit(PyObject) but if maxsplit >=0 and there are more feasible
splits than maxsplit the last element of the list contains the rest of the
string. |
PyList |
rsplit(String sep)
Equivalent to Python
str.rsplit() , splitting on a specified string. |
PyList |
rsplit(String sep,
int maxsplit)
Equivalent to Python
str.rsplit() , splitting on a specified string. |
String |
rstrip()
Equivalent of Python
str.rstrip() with no argument, meaning strip whitespace. |
PyObject |
rstrip(PyObject stripChars)
Equivalent of Python
str.rstrip() . |
String |
rstrip(String stripChars)
Equivalent of Python
str.rstrip() . |
PyList |
split()
Equivalent to Python
str.split() , splitting on runs of whitespace. |
PyList |
split(PyObject sep)
|
PyList |
split(PyObject sep,
int maxsplit)
As
split(PyObject) but if maxsplit >=0 and there are more feasible
splits than maxsplit , the last element of the list contains the rest of the
string. |
PyList |
split(String sep)
Equivalent to Python
str.split() , splitting on a specified string. |
PyList |
split(String sep,
int maxsplit)
Equivalent to Python
str.split() , splitting on a specified string. |
PyList |
splitlines() |
PyList |
splitlines(boolean keepends) |
boolean |
startswith(PyObject prefix)
Equivalent to the Python
str.startswith method testing whether a string starts
with a specified prefix. |
boolean |
startswith(PyObject prefix,
PyObject start)
Equivalent to the Python
str.startswith method, testing whether a string starts
with a specified prefix, where a sub-range is specified by [start:] . |
boolean |
startswith(PyObject prefix,
PyObject start,
PyObject end)
Equivalent to the Python
str.startswith method, testing whether a string starts
with a specified prefix, where a sub-range is specified by [start:end] . |
PyObject |
str___mod__(PyObject other) |
String |
strip()
Equivalent of Python
str.strip() with no argument, meaning strip whitespace. |
PyObject |
strip(PyObject stripChars)
Equivalent of Python
str.strip() . |
String |
strip(String stripChars)
Equivalent of Python
str.strip() . |
String |
substring(int start,
int end)
Return a substring of this object as a Java String.
|
String |
swapcase() |
String |
title() |
byte[] |
toBytes() |
int[] |
toCodePoints() |
String |
toString() |
String |
translate(PyObject table)
Equivalent to Python
str.translate returning a copy of this string where the
characters have been mapped through the translation table . |
String |
translate(PyObject table,
PyObject deletechars)
Equivalent to Python
str.translate returning a copy of this string where all
characters (bytes) occurring in the argument deletechars are removed (if it is
not null ), and the remaining characters have been mapped through the translation
table . |
String |
translate(String table)
Equivalent to
translate(PyObject) specialized to String . |
String |
translate(String table,
String deletechars)
Equivalent to
translate(PyObject, PyObject) specialized to String . |
String |
upper() |
String |
zfill(int width) |
__delitem__, __delslice__, __finditem__, __finditem__, __getitem__, __getslice__, __iter__, __nonzero__, __setitem__, __setitem__, __setslice__, isMappingType, isNumberType, isSequenceType
__abs__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __coerce__, __coerce_ex__, __delattr__, __delattr__, __delete__, __delitem__, __delslice__, __dir__, __div__, __divmod__, __ensure_finalizer__, __findattr__, __findattr__, __findattr_ex__, __finditem__, __floordiv__, __get__, __getattr__, __getattr__, __getitem__, __getslice__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ifloordiv__, __ilshift__, __imod__, __imul__, __index__, __ior__, __ipow__, __irshift__, __isub__, __iternext__, __itruediv__, __ixor__, __lshift__, __not__, __oct__, __or__, __pow__, __pow__, __radd__, __rand__, __rdiv__, __rdivmod__, __reduce__, __reduce_ex__, __reduce_ex__, __rfloordiv__, __rlshift__, __rmod__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __set__, __setattr__, __setattr__, __setitem__, __setslice__, __sub__, __truediv__, __trunc__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _doget, _doget, _doset, _eq, _floordiv, _ge, _gt, _iadd, _iand, _idiv, _idivmod, _ifloordiv, _ilshift, _imod, _imul, _in, _ior, _ipow, _irshift, _is, _isnot, _isub, _itruediv, _ixor, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _truediv, _xor, asIndex, asIndex, asInt, asIterable, asLong, asName, asStringOrNull, asStringOrNull, bit_length, conjugate, delDict, delType, dispatch__init__, equals, fastGetClass, fastGetDict, getDict, getType, implementsDescrDelete, implementsDescrGet, implementsDescrSet, invoke, invoke, invoke, invoke, invoke, invoke, isCallable, isDataDescr, isIndex, isInteger, noAttributeError, object___subclasshook__, readonlyAttributeError, setDict, setType
public static final PyType TYPE
public PyString()
public PyString(PyType subType, String string)
PyString
objects when the client provides a Java
String
, necessitating that we range check the characters.subType
- the actual type being constructedstring
- a Java String to be wrappedpublic PyString(String string)
public PyString(char c)
public String getString()
public static PyString fromInterned(String interned)
public boolean isBasicPlane()
PyString
, of course, it is always true
, but this is useful in cases
where either a PyString
or a PyUnicode
is acceptable.public int[] toCodePoints()
public PyBuffer getBuffer(int flags)
flags
argument (see the constants in interface PyBUF
for an
explanation). The method may return the same PyBuffer object to more than one consumer.getBuffer
in interface BufferProtocol
flags
- consumer requirementspublic String substring(int start, int end)
start
- the beginning index, inclusive.end
- the ending index, exclusive.public PyString __str__()
PyObject
PyObject
is to
override the standard Java toString
method.public PyUnicode __unicode__()
__unicode__
in class PyObject
public int __len__()
PyObject
public String internedString()
public PyString __repr__()
PyObject
PyObject
is to
override the standard Java toString
method.public static String decode_UnicodeEscape(String str, int start, int end, String errors, boolean unicode)
public int __cmp__(PyObject other)
PyObject
public PyObject __eq__(PyObject other)
PyObject
__eq__
in class PySequence
other
- the object to compare this with.public PyObject __ne__(PyObject other)
PyObject
__ne__
in class PySequence
other
- the object to compare this with.public PyObject __lt__(PyObject other)
PyObject
__lt__
in class PySequence
other
- the object to compare this with.public PyObject __le__(PyObject other)
PyObject
__le__
in class PySequence
other
- the object to compare this with.public PyObject __gt__(PyObject other)
PyObject
__gt__
in class PySequence
other
- the object to compare this with.public PyObject __ge__(PyObject other)
PyObject
__ge__
in class PySequence
other
- the object to compare this with.public byte[] toBytes()
public Object __tojava__(Class<?> c)
PyObject
Py.NoConversion
if this PyObject
can not be converted to the
desired Java class.__tojava__
in class PySequence
c
- the Class to convert this PyObject
to.public int getInt(int i)
public PyString createInstance(String str)
str
- to wrappublic boolean __contains__(PyObject o)
PyObject
__contains__
in class PyObject
o
- the element to search for in this container.public PyObject __mul__(PyObject o)
PyObject
public PyObject __rmul__(PyObject o)
PyObject
public PyTuple __getnewargs__()
__getnewargs__
in class PyObject
public PyObject __mod__(PyObject other)
PyObject
public PyObject __int__()
PyObject
public PyObject __long__()
PyObject
public PyFloat __float__()
PyObject
public PyObject __pos__()
PyObject
public PyObject __neg__()
PyObject
public PyObject __invert__()
PyObject
__invert__
in class PyObject
public PyComplex __complex__()
PyObject
__complex__
in class PyObject
public String lower()
public String upper()
public String title()
public String swapcase()
public String strip()
str.strip()
with no argument, meaning strip whitespace. Any
whitespace byte/character will be discarded from either end of this str
.public String strip(String stripChars)
str.strip()
.stripChars
- characters to strip from either end of this str/bytes, or nullpublic PyObject strip(PyObject stripChars)
str.strip()
. Any byte/character matching one of those in
stripChars
will be discarded from either end of this str
. If
stripChars == null
, whitespace will be stripped. If stripChars
is a
PyUnicode
, the result will also be a PyUnicode
.stripChars
- characters to strip from either end of this str/bytes, or nullPyString
(or PyUnicode
), stripped of the specified
characters/bytespublic String lstrip()
str.lstrip()
with no argument, meaning strip whitespace.
Any whitespace byte/character will be discarded from the left of this str
.public String lstrip(String stripChars)
str.lstrip()
.stripChars
- characters to strip from the left end of this str/bytes, or nullpublic PyObject lstrip(PyObject stripChars)
str.lstrip()
. Any byte/character matching one of those in
stripChars
will be discarded from the left end of this str
. If
stripChars == null
, whitespace will be stripped. If stripChars
is a
PyUnicode
, the result will also be a PyUnicode
.stripChars
- characters to strip from the left end of this str/bytes, or nullPyString
(or PyUnicode
), stripped of the specified
characters/bytespublic String rstrip()
str.rstrip()
with no argument, meaning strip whitespace.
Any whitespace byte/character will be discarded from the right end of this str
.public String rstrip(String stripChars)
str.rstrip()
.stripChars
- characters to strip from either end of this str/bytes, or nullpublic PyObject rstrip(PyObject stripChars)
str.rstrip()
. Any byte/character matching one of those in
stripChars
will be discarded from the right end of this str
. If
stripChars == null
, whitespace will be stripped. If stripChars
is a
PyUnicode
, the result will also be a PyUnicode
.stripChars
- characters to strip from the right end of this str/bytes, or nullPyString
(or PyUnicode
), stripped of the specified
characters/bytespublic PyList split()
str.split()
, splitting on runs of whitespace.public PyList split(String sep)
str.split()
, splitting on a specified string.sep
- string to use as separator (or null
if to split on whitespace)public PyList split(String sep, int maxsplit)
str.split()
, splitting on a specified string.sep
- string to use as separator (or null
if to split on whitespace)maxsplit
- maximum number of splits to make (there may be maxsplit+1
parts).public PyList split(PyObject sep)
str.split()
returning a PyList
of
PyString
s (or PyUnicode
s). The str
will be split at
each occurrence of sep
. If sep == null
, whitespace will be used as
the criterion. If sep
has zero length, a Python ValueError
is
raised.sep
- string to use as separator (or null
if to split on whitespace)public PyList split(PyObject sep, int maxsplit)
split(PyObject)
but if maxsplit
>=0 and there are more feasible
splits than maxsplit
, the last element of the list contains the rest of the
string.sep
- string to use as separator (or null
if to split on whitespace)maxsplit
- maximum number of splits to make (there may be maxsplit+1
parts).public PyList rsplit()
str.rsplit()
, splitting on runs of whitespace.public PyList rsplit(String sep)
str.rsplit()
, splitting on a specified string.sep
- string to use as separator (or null
if to split on whitespace)public PyList rsplit(String sep, int maxsplit)
str.rsplit()
, splitting on a specified string.sep
- string to use as separator (or null
if to split on whitespace)maxsplit
- maximum number of splits to make (there may be maxsplit+1
parts).public PyList rsplit(PyObject sep)
str.rsplit()
returning a PyList
of
PyString
s (or PyUnicode
s). The str
will be split at
each occurrence of sep
, working from the right. If sep == null
,
whitespace will be used as the criterion. If sep
has zero length, a Python
ValueError
is raised.sep
- string to use as separator (or null
if to split on whitespace)public PyList rsplit(PyObject sep, int maxsplit)
rsplit(PyObject)
but if maxsplit
>=0 and there are more feasible
splits than maxsplit
the last element of the list contains the rest of the
string.sep
- string to use as separator (or null
if to split on whitespace)maxsplit
- maximum number of splits to make (there may be maxsplit+1
parts).public PyTuple partition(PyObject sepObj)
str.partition()
, splits the PyString
at the
first occurrence of sepObj
returning a PyTuple
containing the part
before the separator, the separator itself, and the part after the separator.sepObj
- str, unicode or object implementing BufferProtocol
public PyTuple rpartition(PyObject sepObj)
str.rpartition()
, splits the PyString
at the
last occurrence of sepObj
returning a PyTuple
containing the part before
the separator, the separator itself, and the part after the separator.sepObj
- str, unicode or object implementing BufferProtocol
public PyList splitlines()
public PyList splitlines(boolean keepends)
public int index(PyObject sub)
sub
is found. Raises
ValueError
if the substring is not found.sub
- substring to find.sub
in this object.PyException(ValueError)
- if not found.public int index(PyObject sub, PyObject start) throws PyException
sub
is found, such that
sub
is contained in the slice s[start:]
. Raises
ValueError
if the substring is not found.sub
- substring to find.start
- start of slice.sub
in this object.PyException(ValueError)
- if not found.PyException
public int index(PyObject sub, PyObject start, PyObject end) throws PyException
sub
is found, such that
sub
is contained in the slice s[start:end]
. Arguments
start
and end
are interpreted as in slice notation, with null or
Py.None
representing "missing". Raises ValueError
if the substring is
not found.sub
- substring to find.start
- start of slice.end
- end of slice.sub
in this object.PyException(ValueError)
- if not found.PyException
public int index(String sub)
index(PyObject)
specialized to String
.public int index(String sub, PyObject start)
index(PyObject, PyObject)
specialized to String
.public int index(String sub, PyObject start, PyObject end)
index(PyObject, PyObject, PyObject)
specialized to String
.public int rindex(PyObject sub)
sub
is found. Raises
ValueError
if the substring is not found.sub
- substring to find.sub
in this object.PyException(ValueError)
- if not found.public int rindex(PyObject sub, PyObject start) throws PyException
sub
is found, such that
sub
is contained in the slice s[start:]
. Raises
ValueError
if the substring is not found.sub
- substring to find.start
- start of slice.sub
in this object.PyException(ValueError)
- if not found.PyException
public int rindex(PyObject sub, PyObject start, PyObject end) throws PyException
sub
is found, such that
sub
is contained in the slice s[start:end]
. Arguments
start
and end
are interpreted as in slice notation, with null or
Py.None
representing "missing". Raises ValueError
if the substring is
not found.sub
- substring to find.start
- start of slice.end
- end of slice.sub
in this object.PyException(ValueError)
- if not found.PyException
public int rindex(String sub)
rindex(PyObject)
specialized to String
.public int rindex(String sub, PyObject start)
rindex(PyObject, PyObject)
specialized to String
.public int rindex(String sub, PyObject start, PyObject end)
rindex(PyObject, PyObject, PyObject)
specialized to
String
.public int count(PyObject sub)
sub
.sub
- substring to find.public int count(PyObject sub, PyObject start)
sub
in the range
[start:]
.sub
- substring to find.start
- start of slice.public int count(PyObject sub, PyObject start, PyObject end)
sub
in the range
[start:end]
. Optional arguments start
and end
are
interpreted as in slice notation.sub
- substring to find.start
- start of slice.end
- end of slice.public int count(String sub)
count(PyObject)
specialized to String
.public int count(String sub, PyObject start)
count(PyObject, PyObject)
specialized to String
.public int count(String sub, PyObject start, PyObject end)
count(PyObject, PyObject, PyObject)
specialized to String
.public int find(PyObject sub)
sub
is found.sub
- substring to find.sub
in this object or -1 if not found.public int find(PyObject sub, PyObject start)
sub
is found, such that
sub
is contained in the slice s[start:]
.sub
- substring to find.start
- start of slice.sub
in this object or -1 if not found.public int find(PyObject sub, PyObject start, PyObject end)
sub
is found, such that
sub
is contained in the slice s[start:end]
. Arguments
start
and end
are interpreted as in slice notation, with null or
Py.None
representing "missing".sub
- substring to find.start
- start of slice.end
- end of slice.sub
in this object or -1 if not found.public int find(String sub)
find(PyObject)
specialized to String
.public int find(String sub, PyObject start)
find(PyObject, PyObject)
specialized to String
.public int find(String sub, PyObject start, PyObject end)
find(PyObject, PyObject, PyObject)
specialized to String
.public int rfind(PyObject sub)
sub
is found.sub
- substring to find.sub
in this object or -1 if not found.public int rfind(PyObject sub, PyObject start)
sub
is found, such that
sub
is contained in the slice s[start:]
.sub
- substring to find.start
- start of slice.sub
in this object or -1 if not found.public int rfind(PyObject sub, PyObject start, PyObject end)
sub
is found, such that
sub
is contained in the slice s[start:end]
. Arguments
start
and end
are interpreted as in slice notation, with null or
Py.None
representing "missing".sub
- substring to find.start
- start of slice.end
- end of slice.sub
in this object or -1 if not found.public int rfind(String sub)
find(PyObject)
specialized to String
.public int rfind(String sub, PyObject start)
find(PyObject, PyObject)
specialized to String
.public int rfind(String sub, PyObject start, PyObject end)
find(PyObject, PyObject, PyObject)
specialized to String
.public double atof()
public int atoi()
public int atoi(int base)
public PyLong atol()
public PyLong atol(int base)
public String ljust(int width)
public String rjust(int width)
public String center(int width)
public String zfill(int width)
public String expandtabs()
public String expandtabs(int tabsize)
public String capitalize()
public PyString replace(PyObject oldPiece, PyObject newPiece)
PyUnicode
(or
this object is), the result will be a PyUnicode
.oldPiece
- to replace where found.newPiece
- replacement text.public PyString replace(PyObject oldPiece, PyObject newPiece, int count)
count
is nonnegative,
only the first count
occurrences are replaced. If either argument is a
PyUnicode
(or this object is), the result will be a PyUnicode
.oldPiece
- to replace where found.newPiece
- replacement text.count
- maximum number of replacements to make, or -1 meaning all of them.public boolean startswith(PyObject prefix)
str.startswith
method testing whether a string starts
with a specified prefix. prefix
can also be a tuple of prefixes to look for.prefix
- string to check for (or a PyTuple
of them).true
if this string slice starts with a specified prefix, otherwise
false
.public boolean startswith(PyObject prefix, PyObject start)
str.startswith
method, testing whether a string starts
with a specified prefix, where a sub-range is specified by [start:]
.
start
is interpreted as in slice notation, with null or Py.None
representing "missing". prefix
can also be a tuple of prefixes to look for.prefix
- string to check for (or a PyTuple
of them).start
- start of slice.true
if this string slice starts with a specified prefix, otherwise
false
.public boolean startswith(PyObject prefix, PyObject start, PyObject end)
str.startswith
method, testing whether a string starts
with a specified prefix, where a sub-range is specified by [start:end]
.
Arguments start
and end
are interpreted as in slice notation, with
null or Py.None
representing "missing". prefix
can also be a tuple of
prefixes to look for.prefix
- string to check for (or a PyTuple
of them).start
- start of slice.end
- end of slice.true
if this string slice starts with a specified prefix, otherwise
false
.public boolean endswith(PyObject suffix)
str.endswith
method, testing whether a string ends with
a specified suffix. suffix
can also be a tuple of suffixes to look for.suffix
- string to check for (or a PyTuple
of them).true
if this string slice ends with a specified suffix, otherwise
false
.public boolean endswith(PyObject suffix, PyObject start)
str.endswith
method, testing whether a string ends with
a specified suffix, where a sub-range is specified by [start:]
.
start
is interpreted as in slice notation, with null or Py.None
representing "missing". suffix
can also be a tuple of suffixes to look for.suffix
- string to check for (or a PyTuple
of them).start
- start of slice.true
if this string slice ends with a specified suffix, otherwise
false
.public boolean endswith(PyObject suffix, PyObject start, PyObject end)
str.endswith
method, testing whether a string ends with
a specified suffix, where a sub-range is specified by [start:end]
. Arguments
start
and end
are interpreted as in slice notation, with null or
Py.None
representing "missing". suffix
can also be a tuple of suffixes
to look for.suffix
- string to check for (or a PyTuple
of them).start
- start of slice.end
- end of slice.true
if this string slice ends with a specified suffix, otherwise
false
.public String translate(PyObject table)
str.translate
returning a copy of this string where the
characters have been mapped through the translation table
. table
must be equivalent to a string of length 256 (if it is not null
).table
- of character (byte) translations (or null
)public String translate(PyObject table, PyObject deletechars)
str.translate
returning a copy of this string where all
characters (bytes) occurring in the argument deletechars
are removed (if it is
not null
), and the remaining characters have been mapped through the translation
table
. table
must be equivalent to a string of length 256 (if it is
not null
).table
- of character (byte) translations (or null
)deletechars
- set of characters to remove (or null
)public String translate(String table)
translate(PyObject)
specialized to String
.public String translate(String table, String deletechars)
translate(PyObject, PyObject)
specialized to String
.public boolean islower()
public boolean isupper()
public boolean isalpha()
public boolean isalnum()
public boolean isdecimal()
public boolean isdigit()
public boolean isnumeric()
public boolean istitle()
public boolean isspace()
public boolean isunicode()
public String encode()
public PyObject decode()
public PyObject __format__(PyObject formatSpec)
__format__
in class PyObject
public String asString(int index) throws PyObject.ConversionException
asString
in class PyObject
PyObject.ConversionException
public int asInt()
PyObject
public long asLong()
PyObject
public double asDouble()
PyObject
public String asName(int index) throws PyObject.ConversionException
asName
in class PyObject
PyObject.ConversionException