Skip to main content

str

Standard library class internal.core.str View source
class str
@tuple
class str
Constructors 4
__new__
@__internal__
__new__(p: Ptr[u8], l: int) -> str
__new__
__new__() -> str
__new__
__new__(data: bytes, encoding: str, errors: str = "strict") -> str
__new__
__new__(what) -> str
Methods 53
from_ptr
from_ptr(t: cobj) -> str
find
find(self: Self, sub: str, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
rfind
rfind(self: Self, sub: str, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
index
index(self: Self, sub: str, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
rindex
rindex(self: Self, sub: str, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
count
count(self: Self, sub: str, start: Optional[int] = 0, end: Optional[int] = None, /) -> int
startswith
startswith(self: Self, prefix, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
startswith(self: Self, prefix: str, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
endswith
endswith(self: Self, suffix, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
endswith(self: Self, suffix: str, start: Optional[int] = 0, end: Optional[int] = None, /) -> bool
encode
encode(self: Self, /, encoding: str = "utf-8", errors: str = "strict") -> bytes
c_str
c_str(self: Self) -> cobj
maketrans
@staticmethod
maketrans(x: dict[(int, int)], /) -> dict[(int, int)]
maketrans(x: dict[(int, str)], /) -> dict[(int, str)]
maketrans(x: dict[(int, Optional[int])], /) -> dict[(int, Optional[int])]
maketrans(x: dict[(int, Optional[str])], /) -> dict[(int, Optional[str])]
maketrans(x: str, y: str, /) -> dict[(int, int)]
maketrans(x: str, y: str, z: str, /) -> dict[(int, Optional[int])]
translate
translate(self: Self, table: dict[(int, int)], /) -> str
translate(self: Self, table: dict[(int, str)], /) -> str
translate(self: Self, table: dict[(int, Optional[int])], /) -> str
translate(self: Self, table: dict[(int, Optional[str])], /) -> str
lower
lower(self: Self, /) -> str
upper
upper(self: Self, /) -> str
casefold
casefold(self: Self, /) -> str
capitalize
capitalize(self: Self, /) -> str
title
title(self: Self, /) -> str
swapcase
swapcase(self: Self, /) -> str
removeprefix
removeprefix(self: Self, prefix: str, /) -> str
removesuffix
removesuffix(self: Self, suffix: str, /) -> str
strip
strip(self: Self, chars: Optional[str] = None, /) -> str
lstrip
lstrip(self: Self, chars: Optional[str] = None, /) -> str
rstrip
rstrip(self: Self, chars: Optional[str] = None, /) -> str
split
split(self: Self, /, sep: Optional[str] = None, maxsplit: int = -1) -> List[str]
rsplit
rsplit(self: Self, /, sep: Optional[str] = None, maxsplit: int = -1) -> List[str]
splitlines
splitlines(self: Self, /, keepends: bool = False) -> List[str]
join
join(self: Self, values, /) -> str
join(self: Self, values: List[str], /) -> str
replace
replace(self: Self, old: str, new: str, /, count: int = -1) -> str
ljust
ljust(self: Self, width: int, /) -> str
ljust(self: Self, width: int, fillchar: str, /) -> str
rjust
rjust(self: Self, width: int, /) -> str
rjust(self: Self, width: int, fillchar: str, /) -> str
center
center(self: Self, width: int, fillchar: str = " ", /) -> str
zfill
zfill(self: Self, width: int, /) -> str
expandtabs
expandtabs(self: Self, /, tabsize: int = 8) -> str
isalnum
isalnum(self: Self, /) -> bool
isalpha
isalpha(self: Self, /) -> bool
isdigit
isdigit(self: Self, /) -> bool
isspace
isspace(self: Self, /) -> bool
isascii
isascii(self: Self, /) -> bool
islower
islower(self: Self, /) -> bool
isupper
isupper(self: Self, /) -> bool
istitle
istitle(self: Self, /) -> bool
isnumeric
isnumeric(self: Self, /) -> bool
isdecimal
isdecimal(self: Self, /) -> bool
isprintable
isprintable(self: Self, /) -> bool
isidentifier
isidentifier(self: Self, /) -> bool
partition
partition(self: Self, sep: str, /) -> Tuple[(str, str, str)]
rpartition
rpartition(self: Self, sep: str, /) -> Tuple[(str, str, str)]
cat
cat(*args) -> str
memcpy
@llvm
memcpy(dest: Ptr[u8], src: Ptr[u8], len: int) -> None
declare void @llvm.memcpy.p0i8.p0i8.i64(ptr %dest, ptr %src, i64 %len, i32 %align, i1 %isvolatile)
call void @llvm.memcpy.p0i8.p0i8.i64(ptr %dest, ptr %src, i64 %len, i32 0, i1 false)
ret {} {}
memmove
@llvm
memmove(dest: Ptr[u8], src: Ptr[u8], len: int) -> None
declare void @llvm.memmove.p0i8.p0i8.i64(ptr %dest, ptr %src, i64 %len, i32 %align, i1 %isvolatile)
call void @llvm.memmove.p0i8.p0i8.i64(ptr %dest, ptr %src, i64 %len, i32 0, i1 false)
ret {} {}
memset
@llvm
memset(dest: Ptr[u8], val: u8, len: int) -> None
declare void @llvm.memset.p0i8.i64(ptr %dest, i8 %val, i64 %len, i32 %align, i1 %isvolatile)
call void @llvm.memset.p0i8.i64(ptr %dest, i8 %val, i64 %len, i32 0, i1 false)
ret {} {}
format
format(self: Self, /, *values) -> str
format_map
format_map(self: Self, mapping, /) -> str
Special methods 30
__len__
__len__(self: Self, /) -> int
__bool__
__bool__(self: Self) -> bool
__match__
__match__(self: Self, other: str) -> bool
__getitem__
__getitem__(self: Self, item: int, /)
__getitem__(self: Self, item: slice[(int, int, int)], /) -> str
__eq__
__eq__(self: Self, other: str, /) -> bool
__ne__
__ne__(self: Self, other: str, /) -> bool
__lt__
__lt__(self: Self, other: str, /) -> bool
__le__
__le__(self: Self, other: str, /) -> bool
__gt__
__gt__(self: Self, other: str, /) -> bool
__ge__
__ge__(self: Self, other: str, /) -> bool
__add__
__add__(self: Self, other: str, /) -> str
__mul__
__mul__(self: Self, count: int, /) -> str
__rmul__
__rmul__(self: Self, count: int, /) -> str
__repr__
__repr__(self: Self, /) -> str
__str__
__str__(self: Self, /) -> str
__contains__
__contains__(self: Self, sub: str, /) -> bool
__copy__
__copy__(self: Self) -> str
__deepcopy__
__deepcopy__(self: Self) -> str
__ptrcopy__
__ptrcopy__(self: Self) -> str
__hash__
__hash__(self: Self, /) -> int
__iter__
__iter__(self: Self, /)
__format__
__format__(self: Self, format_spec: str, /) -> str
__mod__
__mod__(self: Self, values, /) -> str
__to_gpu__
__to_gpu__(self: Self, cache: AllocCache)
Added by internal.gpu
__from_gpu__
__from_gpu__(self: Self, other: str)
Added by internal.gpu
__from_gpu_new__
__from_gpu_new__(other: str)
Added by internal.gpu
__pickle__
__pickle__(self: Self, jar: Jar)
Added by pickle
__unpickle__
__unpickle__(jar: Jar) -> str
Added by pickle
__to_py__
__to_py__(self: Self) -> cobj
__from_py__
__from_py__(s: cobj) -> str