Expand description
String operations for Seq
These functions are exported with C ABI for LLVM codegen to call.
§Design Decision: split Return Value
split uses Option A (push parts + count):
- “a b c” “ “ split → “a” “b” “c” 3
This is the simplest approach, requiring no new types. The count allows the caller to know how many parts were pushed.
Re-exports§
pub use patch_seq_char_to_string as char_to_string;pub use patch_seq_json_escape as json_escape;pub use patch_seq_string_byte_length as string_byte_length;pub use patch_seq_string_char_at as string_char_at;pub use patch_seq_string_concat as string_concat;pub use patch_seq_string_contains as string_contains;pub use patch_seq_string_empty as string_empty;pub use patch_seq_string_equal as string_equal;pub use patch_seq_string_find as string_find;pub use patch_seq_string_length as string_length;pub use patch_seq_string_split as string_split;pub use patch_seq_string_starts_with as string_starts_with;pub use patch_seq_string_substring as string_substring;pub use patch_seq_string_to_int as string_to_int;pub use patch_seq_string_to_lower as string_to_lower;pub use patch_seq_string_to_upper as string_to_upper;pub use patch_seq_string_trim as string_trim;
Functions§
- patch_
seq_ ⚠char_ to_ string - Convert a Unicode code point to a single-character string
- patch_
seq_ ⚠json_ escape - Escape a string for JSON output
- patch_
seq_ ⚠string_ byte_ length - Get the byte length of a string (UTF-8 encoded)
- patch_
seq_ ⚠string_ char_ at - Get the Unicode code point at a character index
- patch_
seq_ ⚠string_ concat - Concatenate two strings
- patch_
seq_ ⚠string_ contains - Check if a string contains a substring
- patch_
seq_ ⚠string_ empty - Check if a string is empty
- patch_
seq_ ⚠string_ equal - Check if two strings are equal
- patch_
seq_ ⚠string_ find - Find the first occurrence of a substring
- patch_
seq_ ⚠string_ length - Get the length of a string in Unicode characters (code points)
- patch_
seq_ ⚠string_ split - Split a string on a delimiter
- patch_
seq_ ⚠string_ starts_ with - Check if a string starts with a prefix
- patch_
seq_ ⚠string_ substring - Extract a substring using character indices
- patch_
seq_ ⚠string_ to_ int - Convert String to Int: ( String – Int Int ) Returns the parsed int and 1 on success, or 0 and 0 on failure. Accepts integers in range [-9223372036854775808, 9223372036854775807] (i64). Trims leading/trailing whitespace before parsing. Leading zeros are accepted (e.g., “007” parses to 7).
- patch_
seq_ ⚠string_ to_ lower - Convert a string to lowercase
- patch_
seq_ ⚠string_ to_ upper - Convert a string to uppercase
- patch_
seq_ ⚠string_ trim - Trim whitespace from both ends of a string