Skip to content

module internal.str

Source: stdlib/internal/str.codon


str @extend Class is extended to add given methods

Magic methods

__hash__(self)

__lt__(self, other: str)

__le__(self, other: str)

__gt__(self, other: str)

__ge__(self, other: str)

__repr__(self)

__getitem__(self, idx: int)

__getitem__(self, s: Slice)

__iter__(self)

__reversed__(self)

__mul__(self, x: int)


str @extend Class is extended to add given methods

Magic methods

__contains__(self, pattern: str)

Methods

join(self, l: Generator[str])

join(self, l: List[str])

isdigit(self)

islower(self)

isupper(self)

isalnum(self)

isalpha(self)

isspace(self)

istitle(self)

capitalize(self)

isdecimal(self)

lower(self)

upper(self)

isascii(self)

casefold(self)

swapcase(self)

title(self)

isnumeric(self)

ljust(self, width: int, fillchar: str = " ")

rjust(self, width: int, fillchar: str = " ")

center(self, width: int, fillchar: str = " ")

zfill(self, width: int)

count(self, sub: str, start: int = 0, end: Optional[int] = None)

find(self, sub: str, start: int = 0, end: Optional[int] = None)

rfind(self, sub: str, start: int = 0, end: Optional[int] = None)

isidentifier(self)

isprintable(self)

lstrip(self, chars: str = "")

rstrip(self, chars: str = "")

strip(self, chars: str = "")

partition(self, sep: str)

rpartition(self, sep: str)

split(self, sep: Optional[str] = None, maxsplit: int = -1)

rsplit(self, sep: Optional[str] = None, maxsplit: int = -1)

splitlines(self, keepends: bool = False)

startswith(self, prefix: str, start: int = 0, end: Optional[int] = None)

endswith(self, suffix: str, start: int = 0, end: Optional[int] = None)

index(self, sub: str, start: int = 0, end: Optional[int] = None)

rindex(self, sub: str, start: int = 0, end: Optional[int] = None)

replace(self, old: str, new: str, maxcount: int = -1)

expandtabs(self, tabsize: int = 8)

translate(self, map)