For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
len
len(value: StringSlice) -> Int
Get the string length.
Deprecated: Using String.len() is discouraged, prefer .byte_length() or .count_codepoints()
Args:
- value (
StringSlice): The object to get the length of.
Returns:
Int: The length of this value.
len[T: Sized](value: T) -> Int
Get the length of a value.
Parameters:
- T (
Sized): The Sized type.
Args:
- value (
T): The object to get the length of.
Returns:
Int: The length of the object.
len[T: SizedRaising](value: T) -> Int
Get the length of a value.
Parameters:
- T (
SizedRaising): The Sized type.
Args:
- value (
T): The object to get the length of.
Returns:
Int: The length of the object.
Raises:
If the length cannot be computed.