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

Class str

object --+
         |
        str


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
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature (inherited from object)
  __add__(x, y)
Return x+y
  __contains__(x, y)
Return y in x
  __delattr__(...)
x.__delattr__('name') <==> del x.name (inherited from object)
  __eq__(x, y)
Return x==y
  __ge__(x, y)
Return x>=y
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __getitem__(x, y)
Return x[y]
  __getslice__(x, i, j)
Return x[i:j]
  __gt__(x, y)
Return x>y
  __hash__(x)
Return hash(x)
  __le__(x, y)
Return x<=y
  __len__(x)
Return len(x)
  __lt__(x, y)
Return x<y
  __mul__(x, n)
Return x*n
  __ne__(x, y)
Return x!=y
  __new__(T, S, ...)
Return a new object with type S, a subtype of T (inherited from type)
  __reduce__(...)
helper for pickle (inherited from object)
  __repr__(x)
Return repr(x)
  __rmul__(x, n)
Return n*x
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value (inherited from object)
  __str__(x)
Return str(x)
  capitalize(S)
S.capitalize() -> string
  center(S, width)
S.center(width) -> string
  count(S, sub, start, end)
S.count(sub[, start[, end]]) -> int
  decode(S, encoding, errors)
S.decode([encoding[,errors]]) -> object
  encode(S, encoding, errors)
S.encode([encoding[,errors]]) -> object
  endswith(S, suffix, start, end)
S.endswith(suffix[, start[, end]]) -> int
  expandtabs(S, tabsize)
S.expandtabs([tabsize]) -> string
  find(S, sub, start, end)
S.find(sub [,start [,end]]) -> int
  index(S, sub, start, end)
S.index(sub [,start [,end]]) -> int
  isalnum(S)
S.isalnum() -> int
  isalpha(S)
S.isalpha() -> int
  isdigit(S)
S.isdigit() -> int
  islower(S)
S.islower() -> int
  isspace(S)
S.isspace() -> int
  istitle(S)
S.istitle() -> int
  isupper(S)
S.isupper() -> int
  join(S, sequence)
S.join(sequence) -> string
  ljust(S, width)
S.ljust(width) -> string
  lower(S)
S.lower() -> string
  lstrip(S, sep)
S.lstrip([sep]) -> string or unicode
  replace(...)
S.replace (old, new[, maxsplit]) -> string
  rfind(S, sub, start, end)
S.rfind(sub [,start [,end]]) -> int
  rindex(S, sub, start, end)
S.rindex(sub [,start [,end]]) -> int
  rjust(S, width)
S.rjust(width) -> string
  rstrip(S, sep)
S.rstrip([sep]) -> string or unicode
  split(S, sep, maxsplit)
S.split([sep [,maxsplit]]) -> list of strings
  splitlines(S, keepends)
S.splitlines([keepends]) -> list of strings
  startswith(S, prefix, start, end)
S.startswith(prefix[, start[, end]]) -> int
  strip(S, sep)
S.strip([sep]) -> string or unicode
  swapcase(S)
S.swapcase() -> string
  title(S)
S.title() -> string
  translate(S, table, deletechars)
S.translate(table [,deletechars]) -> string
  upper(S)
S.upper() -> string
  zfill(S, width)
S.zfill(width) -> string

Method Details

__add__(x, y)
(Addition operator)

Returns:
x+y

__contains__(x, y)
(In operator)

Returns:
y in x

__eq__(x, y)
(Equality operator)

Returns:
x==y

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

Returns:
x>=y

__getattribute__(...)

x.__getattribute__('name') <==> x.name

__getitem__(x, y)
(Indexing operator)

Returns:
x[y]

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

Returns:
x[i:j]

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

Returns:
x>y

__hash__(x)
(Hashing function)

Returns:
hash(x)

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

Returns:
x<=y

__len__(x)
(Length operator)

Returns:
len(x)

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

Returns:
x<y

__mul__(x, n)

Returns:
x*n

__ne__(x, y)

Returns:
x!=y

__repr__(x)
(Representation operator)

Returns:
repr(x)

__rmul__(x, n)

Returns:
n*x

__str__(x)
(Informal representation operator)

Returns:
str(x)

capitalize(S)

S.capitalize() -> string

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

center(S, width)

S.center(width) -> string

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

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

S.count(sub[, start[, end]]) -> int

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=...)

S.decode([encoding[,errors]]) -> object

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 ValueError. Other possible values are 'ignore' and 'replace'.
Returns:
object

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

S.encode([encoding[,errors]]) -> object

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 ValueError. Other possible values are 'ignore' and 'replace'.
Returns:
object

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

S.endswith(suffix[, start[, end]]) -> int

Return 1 if S ends with the specified suffix, otherwise return 0. With optional start, test S beginning at that position. With optional end, stop comparing S at that position.
Returns:
int

expandtabs(S, tabsize=...)

S.expandtabs([tabsize]) -> string

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=...)

S.find(sub [,start [,end]]) -> int

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=...)

S.index(sub [,start [,end]]) -> int

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

isalnum(S)

S.isalnum() -> int

Return 1 if all characters in S are alphanumeric and there is at least one character in S, 0 otherwise.
Returns:
int

isalpha(S)

S.isalpha() -> int

Return 1 if all characters in S are alphabetic and there is at least one character in S, 0 otherwise.
Returns:
int

isdigit(S)

S.isdigit() -> int

Return 1 if there are only digit characters in S, 0 otherwise.
Returns:
int

islower(S)

S.islower() -> int

Return 1 if all cased characters in S are lowercase and there is at least one cased character in S, 0 otherwise.
Returns:
int

isspace(S)

S.isspace() -> int

Return 1 if there are only whitespace characters in S, 0 otherwise.
Returns:
int

istitle(S)

S.istitle() -> int

Return 1 if S is a titlecased string, i.e. uppercase characters may only follow uncased characters and lowercase characters only cased ones. Return 0 otherwise.
Returns:
int

isupper(S)

S.isupper() -> int

Return 1 if all cased characters in S are uppercase and there is at least one cased character in S, 0 otherwise.
Returns:
int

join(S, sequence)

S.join(sequence) -> string

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

ljust(S, width)

S.ljust(width) -> string

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

lower(S)

S.lower() -> string

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

lstrip(S, sep=...)

S.lstrip([sep]) -> string or unicode

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

replace(...)

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

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

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

S.rfind(sub [,start [,end]]) -> int

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=...)

S.rindex(sub [,start [,end]]) -> int

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

rjust(S, width)

S.rjust(width) -> string

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

rstrip(S, sep=...)

S.rstrip([sep]) -> string or unicode

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

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

S.split([sep [,maxsplit]]) -> list of strings

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=...)

S.splitlines([keepends]) -> list of strings

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=...)

S.startswith(prefix[, start[, end]]) -> int

Return 1 if S starts with the specified prefix, otherwise return 0. With optional start, test S beginning at that position. With optional end, stop comparing S at that position.
Returns:
int

strip(S, sep=...)

S.strip([sep]) -> string or unicode

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

swapcase(S)

S.swapcase() -> string

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

title(S)

S.title() -> string

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=...)

S.translate(table [,deletechars]) -> string

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)

S.upper() -> string

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

zfill(S, width)

S.zfill(width) -> string

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 1.2 prerelease on Wed Jan 29 06:25:25 2003 http://epydoc.sf.net