def lower(s):
"""lower(s) -> string
- Return a copy of the string s converted to lowercase
+ Return a copy of the string s converted to lowercase.
"""
res = ''
def upper(s):
"""upper(s) -> string
- Return a copy of the string s converted to uppercase
+ Return a copy of the string s converted to uppercase.
"""
res = ''
# Swap lower case letters and UPPER CASE
def swapcase(s):
- """swapcase(s) -> strng
+ """swapcase(s) -> string
Return a copy of the string s with upper case characters
- converted to lowercase and vice versa
+ converted to lowercase and vice versa.
"""
res = ''
"""strip(s) -> string
Return a copy of the string s with leading and trailing
- whitespace removed
+ whitespace removed.
"""
i, j = 0, len(s)
def lstrip(s):
"""lstrip(s) -> string
- Return a copy of the string s with leading whitespace removed
+ Return a copy of the string s with leading whitespace removed.
"""
i, j = 0, len(s)
def rstrip(s):
"""rstrip(s) -> string
- Return a copy of the string s with trailing whitespace removed
+ Return a copy of the string s with trailing whitespace
+ removed.
"""
i, j = 0, len(s)
res.append(s[i:j])
i = j = j + nsep
if count >= maxsplit: break
-
else:
j = j + 1
res.append(s[i:])
"""join(list [,sep]) -> string
Return a string composed of the words in list, with
- intervening occurences of sep. The default separator is a
- single space.
+ intervening occurences of sep. Sep defaults to a single
+ space.
(joinfields and join are synonymous)
- """
+ """
return joinfields(words, sep)
# Join fields with optional separator
such that sub is contained within s[start,end]. Optional
arguments start and end are interpreted as in slice notation.
- Returns -1 on failure.
+ Return -1 on failure.
"""
Slen = len(s) # cache this value, for speed
Return a copy of the string s with all tab characters replaced
by the appropriate number of spaces, depending on the current
- column, and the tabsize (default=8).
+ column, and the tabsize (default 8).
"""
res = line = ''
def lower(s):
"""lower(s) -> string
- Return a copy of the string s converted to lowercase
+ Return a copy of the string s converted to lowercase.
"""
res = ''
def upper(s):
"""upper(s) -> string
- Return a copy of the string s converted to uppercase
+ Return a copy of the string s converted to uppercase.
"""
res = ''
# Swap lower case letters and UPPER CASE
def swapcase(s):
- """swapcase(s) -> strng
+ """swapcase(s) -> string
Return a copy of the string s with upper case characters
- converted to lowercase and vice versa
+ converted to lowercase and vice versa.
"""
res = ''
"""strip(s) -> string
Return a copy of the string s with leading and trailing
- whitespace removed
+ whitespace removed.
"""
i, j = 0, len(s)
def lstrip(s):
"""lstrip(s) -> string
- Return a copy of the string s with leading whitespace removed
+ Return a copy of the string s with leading whitespace removed.
"""
i, j = 0, len(s)
def rstrip(s):
"""rstrip(s) -> string
- Return a copy of the string s with trailing whitespace removed
+ Return a copy of the string s with trailing whitespace
+ removed.
"""
i, j = 0, len(s)
res.append(s[i:j])
i = j = j + nsep
if count >= maxsplit: break
-
else:
j = j + 1
res.append(s[i:])
"""join(list [,sep]) -> string
Return a string composed of the words in list, with
- intervening occurences of sep. The default separator is a
- single space.
+ intervening occurences of sep. Sep defaults to a single
+ space.
(joinfields and join are synonymous)
- """
+ """
return joinfields(words, sep)
# Join fields with optional separator
such that sub is contained within s[start,end]. Optional
arguments start and end are interpreted as in slice notation.
- Returns -1 on failure.
+ Return -1 on failure.
"""
Slen = len(s) # cache this value, for speed
Return a copy of the string s with all tab characters replaced
by the appropriate number of spaces, depending on the current
- column, and the tabsize (default=8).
+ column, and the tabsize (default 8).
"""
res = line = ''
/* strop module */
static char strop_module__doc__[] =
-"Common string manipulations, optimized for speed\n\
+"Common string manipulations, optimized for speed.\n\
+
Always use \"import string\" rather than referencing\n\
-this module directly";
+this module directly.";
#include "Python.h"
joinfields(list [,sep]) -> string\n\
\n\
Return a string composed of the words in list, with\n\
-intervening occurences of sep. The default separator is a\n\
-single space.\n\
+intervening occurences of sep. Sep defaults to a single\n\
+space.\n\
\n\
-(joinfields and join are synonymous)";
+(join and joinfields are synonymous)";
static PyObject *
strop_joinfields(self, args)