98 const char *
n = (needle && needle->
type ==
VAL_STRING && needle->
s) ? needle->
s :
"";
char * string_substr(const char *s, int start, int len)
Create a newly allocated substring of s.
char * array_join_with_sep(const Value *v, const char *sep)
Join the elements of a Value array into a single newly allocated C string.
int string_find(const char *hay, const char *needle)
Find first occurrence of needle in hay.
Value string_split_to_array(const char *s, const char *sep)
Split a C string by separator into a Value array of strings.
int bi_find(const Value *hay, const Value *needle)
Find the first occurrence of a needle inside a haystack string.
Value bi_split(const Value *str, const Value *sep)
Split a string by a separator into an array Value.
Value bi_join(const Value *arr, const Value *sep)
Join an array of strings with a separator into a single string Value.
Value bi_substr(const Value *str, int start, int len)
Extract a substring from a string Value.
Tagged union representing a Fun value.
Value make_string(const char *s)
Construct a string Value by duplicating the given C string.
Defines the Value type and associated functions for the Fun VM.