Module __builtin__ :: Class str
[show private | hide private]
[frames | no frames]

Class str

object --+    
         |    
basestring --+
             |
            str

Known Subclasses:
QuotedString

str(object) -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Method Summary
  __add__(x, y)
x.__add__(y) <==> x+y...
  __contains__(x, y)
x.__contains__(y) <==> y in x...
  __eq__(x, y)
x.__eq__(y) <==> x==y...
  __ge__(x, y)
x.__ge__(y) <==> x>=y...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __getitem__(x, y)
x.__getitem__(y) <==> x[y]...
  __getnewargs__(...)
  __getslice__(x, i, j)
Use of negative indices is not supported.
  __gt__(x, y)
x.__gt__(y) <==> x>y...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __le__(x, y)
x.__le__(y) <==> x<=y...
  __len__(x)
x.__len__() <==> len(x)...
  __lt__(x, y)
x.__lt__(y) <==> x<y...
  __mod__(x, y)
x.__mod__(y) <==> x%y...
  __mul__(x, n)
x.__mul__(n) <==> x*n...
  __ne__(x, y)
x.__ne__(y) <==> x!=y...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __rmod__(x, y)
x.__rmod__(y) <==> y%x...
  __rmul__(x, n)
x.__rmul__(n) <==> n*x...
  __str__(x)
x.__str__() <==> str(x)...
  capitalize(S)
Return a copy of the string S with only its first character capitalized.
  center(S, width)
Return S centered in a string of length width.
  count(S, sub, start, end)
Return the number of occurrences of substring sub in string S[start:end].
  decode(S, encoding, errors)
Decodes S using the codec registered for encoding.
  encode(S, encoding, errors)
Encodes S using the codec registered for encoding.
  endswith(S, suffix, start, end)
Return True if S ends with the specified suffix, False otherwise.
  expandtabs(S, tabsize)
Return a copy of S where all tab characters are expanded using spaces.
  find(S, sub, start, end)
Return the lowest index in S where substring sub is found, such that sub is contained within s[start,end].
  index(S, sub, start, end)
Like S.find() but raise ValueError when the substring is not found.
  isalnum(S)
Return True if all characters in S are alphanumeric and there is at least one character in S, False otherwise.
  isalpha(S)
Return True if all characters in S are alphabetic and there is at least one character in S, False otherwise.
  isdigit(S)
Return True if all characters in S are digits and there is at least one character in S, False otherwise.
  islower(S)
Return True if all cased characters in S are lowercase and there is at least one cased character in S, False otherwise.
  isspace(S)
Return True if all characters in S are whitespace and there is at least one character in S, False otherwise.
  istitle(S)
Return True if S is a titlecased string and there is at least one character in S, i.e.
  isupper(S)
Return True if all cased characters in S are uppercase and there is at least one cased character in S, False otherwise.
  join(S, sequence)
Return a string which is the concatenation of the strings in the sequence.
  ljust(S, width)
Return S left justified in a string of length width.
  lower(S)
Return a copy of the string S converted to lowercase.
  lstrip(S, chars)
Return a copy of the string S with leading whitespace removed.
  replace(...)
S.replace (old, new[, count]) -> string Return a copy of string S with all occurrences of substring old replaced by new.
  rfind(S, sub, start, end)
Return the highest index in S where substring sub is found, such that sub is contained within s[start,end].
  rindex(S, sub, start, end)
Like S.rfind() but raise ValueError when the substring is not found.
  rjust(S, width)
Return S right justified in a string of length width.
  rstrip(S, chars)
Return a copy of the string S with trailing whitespace removed.
  split(S, sep, maxsplit)
Return a list of the words in the string S, using sep as the delimiter string.
  splitlines(S, keepends)
Return a list of the lines in S, breaking at line boundaries.
  startswith(S, prefix, start, end)
Return True if S starts with the specified prefix, False otherwise.
  strip(S, chars)
Return a copy of the string S with leading and trailing whitespace removed.
  swapcase(S)
Return a copy of the string S with uppercase characters converted to lowercase and vice versa.
  title(S)
Return a titlecased version of S, i.e.
  translate(S, table, deletechars)
Return a copy of the string S, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256.
  upper(S)
Return a copy of the string S converted to uppercase.
  zfill(S, width)
Pad a numeric string S with zeros on the left, to fill a field of the specified width.
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature...
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...

Method Details

__add__(x, y)
(Addition operator)

x.__add__(y) <==> x+y
Returns:
x+y

__contains__(x, y)
(In operator)

x.__contains__(y) <==> y in x
Returns:
y in x

__eq__(x, y)
(Equality operator)

x.__eq__(y) <==> x==y
Returns:
x==y

__ge__(x, y)
(Greater-than-or-equals operator)

x.__ge__(y) <==> x>=y
Returns:
x>=y

__getattribute__(...)

x.__getattribute__('name') <==> x.name
Overrides:
__builtin__.object.__getattribute__

__getitem__(x, y)
(Indexing operator)

x.__getitem__(y) <==> x[y]
Returns:
x[y]

__getslice__(x, i, j)
(Slicling operator)

Use of negative indices is not supported.
Returns:
x[i:j]

__gt__(x, y)
(Greater-than operator)

x.__gt__(y) <==> x>y
Returns:
x>y

__hash__(x)
(Hashing function)

x.__hash__() <==> hash(x)
Returns:
hash(x)
Overrides:
__builtin__.object.__hash__

__le__(x, y)
(Less-than-or-equals operator)

x.__le__(y) <==> x<=y
Returns:
x<=y

__len__(x)
(Length operator)

x.__len__() <==> len(x)
Returns:
len(x)

__lt__(x, y)
(Less-than operator)

x.__lt__(y) <==> x<y
Returns:
x<y

__mod__(x, y)

x.__mod__(y) <==> x%y
Returns:
x%y

__mul__(x, n)

x.__mul__(n) <==> x*n
Returns:
x*n

__ne__(x, y)

x.__ne__(y) <==> x!=y
Returns:
x!=y

__repr__(x)
(Representation operator)

x.__repr__() <==> repr(x)
Returns:
repr(x)
Overrides:
__builtin__.object.__repr__

__rmod__(x, y)

x.__rmod__(y) <==> y%x
Returns:
y%x

__rmul__(x, n)

x.__rmul__(n) <==> n*x
Returns:
n*x

__str__(x)
(Informal representation operator)

x.__str__() <==> str(x)
Returns:
str(x)
Overrides:
__builtin__.object.__str__

capitalize(S)

Return a copy of the string S with only its first character
capitalized.
Returns:
string

center(S, width)

Return S centered in a string of length width. Padding is done
using spaces.
Returns:
string

count(S, sub, start=..., end=...)

Return the number of occurrences of substring sub in string
S[start:end].  Optional arguments start and end are
interpreted as in slice notation.
Returns:
int

decode(S, encoding=..., errors=...)

Decodes S using the codec registered for encoding. encoding defaults
to the default encoding. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'
as well as any other name registerd with codecs.register_error that is
able to handle UnicodeDecodeErrors.
Returns:
object

encode(S, encoding=..., errors=...)

Encodes S using the codec registered for encoding. encoding defaults
to the default encoding. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
'xmlcharrefreplace' as well as any other name registered with
codecs.register_error that is able to handle UnicodeEncodeErrors.
Returns:
object

endswith(S, suffix, start=..., end=...)

Return True if S ends with the specified suffix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
Returns:
bool

expandtabs(S, tabsize=...)

Return a copy of S where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
Returns:
string

find(S, sub, start=... , end=...)

Return the lowest index in S where substring sub is found,
such that sub is contained within s[start,end].  Optional
arguments start and end are interpreted as in slice notation.

Return -1 on failure.
Returns:
int

index(S, sub, start=... , end=...)

Like S.find() but raise ValueError when the substring is not found.
Returns:
int

isalnum(S)

Return True if all characters in S are alphanumeric
and there is at least one character in S, False otherwise.
Returns:
bool

isalpha(S)

Return True if all characters in S are alphabetic
and there is at least one character in S, False otherwise.
Returns:
bool

isdigit(S)

Return True if all characters in S are digits
and there is at least one character in S, False otherwise.
Returns:
bool

islower(S)

Return True if all cased characters in S are lowercase and there is
at least one cased character in S, False otherwise.
Returns:
bool

isspace(S)

Return True if all characters in S are whitespace
and there is at least one character in S, False otherwise.
Returns:
bool

istitle(S)

Return True if S is a titlecased string and there is at least one
character in S, i.e. uppercase characters may only follow uncased
characters and lowercase characters only cased ones. Return False
otherwise.
Returns:
bool

isupper(S)

Return True if all cased characters in S are uppercase and there is
at least one cased character in S, False otherwise.
Returns:
bool

join(S, sequence)

Return a string which is the concatenation of the strings in the
sequence.  The separator between elements is S.
Returns:
string

ljust(S, width)

Return S left justified in a string of length width. Padding is
done using spaces.
Returns:
string

lower(S)

Return a copy of the string S converted to lowercase.
Returns:
string

lstrip(S, chars=...)

Return a copy of the string S with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is unicode, S will be converted to unicode before stripping
Returns:
string or unicode

replace(...)

S.replace (old, new[, count]) -> string

Return a copy of string S with all occurrences of substring
old replaced by new.  If the optional argument count is
given, only the first count occurrences are replaced.

rfind(S, sub, start=... , end=...)

Return the highest index in S where substring sub is found,
such that sub is contained within s[start,end].  Optional
arguments start and end are interpreted as in slice notation.

Return -1 on failure.
Returns:
int

rindex(S, sub, start=... , end=...)

Like S.rfind() but raise ValueError when the substring is not found.
Returns:
int

rjust(S, width)

Return S right justified in a string of length width. Padding is
done using spaces.
Returns:
string

rstrip(S, chars=...)

Return a copy of the string S with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is unicode, S will be converted to unicode before stripping
Returns:
string or unicode

split(S, sep=... , maxsplit=...)

Return a list of the words in the string S, using sep as the
delimiter string.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None, any
whitespace string is a separator.
Returns:
list of strings

splitlines(S, keepends=...)

Return a list of the lines in S, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends
is given and true.
Returns:
list of strings

startswith(S, prefix, start=..., end=...)

Return True if S starts with the specified prefix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
Returns:
bool

strip(S, chars=...)

Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is unicode, S will be converted to unicode before stripping
Returns:
string or unicode

swapcase(S)

Return a copy of the string S with uppercase characters
converted to lowercase and vice versa.
Returns:
string

title(S)

Return a titlecased version of S, i.e. words start with uppercase
characters, all remaining cased characters have lowercase.
Returns:
string

translate(S, table, deletechars=...)

Return a copy of the string S, where all characters occurring
in the optional argument deletechars are removed, and the
remaining characters have been mapped through the given
translation table, which must be a string of length 256.
Returns:
string

upper(S)

Return a copy of the string S converted to uppercase.
Returns:
string

zfill(S, width)

Pad a numeric string S with zeros on the left, to fill a field
of the specified width.  The string S is never truncated.
Returns:
string

Generated by Epydoc 2.0 on Sun Sep 25 20:49:13 2005 http://epydoc.sf.net