Function in stdx_string.h

x_slice_utf8_ends_with_cstr

Checks whether a string view ends with the given C-string suffix.

X_STRING_API bool x_slice_utf8_ends_with_cstr(
 XSlice sv,
 const char *prefix
);

Parameters

XSlice sv
String view input.
const char *prefix
Prefix to match.

Returns

true if the condition holds; false otherwise.

Function in stdx_string.h

x_slice_utf8_find

Finds the first occurrence of a character in a string view.

X_STRING_API int32_t x_slice_utf8_find(
 XSlice sv,
 uint32_t codepoint
);

Parameters

XSlice sv
String view input.
uint32_t codepoint
Unicode codepoint value.

Returns

Index on success, or -1 if not found.

Function in stdx_string.h

x_slice_utf8_next_token

Extracts the next token delimited by a UTF-8 codepoint.

X_STRING_API bool x_slice_utf8_next_token(
 XSlice *input,
 uint32_t codepoint,
 XSlice *token
);

Parameters

XSlice *input
Parameter.
uint32_t codepoint
Unicode codepoint value.
XSlice *token
Output: extracted token.

Returns

Function-specific result.

Function in stdx_string.h

x_slice_utf8_rfind

Finds the last occurrence of a UTF-8 codepoint in a string view.

X_STRING_API int32_t x_slice_utf8_rfind(
 XSlice sv,
 uint32_t codepoint
);

Parameters

XSlice sv
String view input.
uint32_t codepoint
Unicode codepoint value.

Returns

Index on success, or -1 if not found.

Function in stdx_string.h

x_slice_utf8_split_at

Splits a string view at the first occurrence of a delimiter.

X_STRING_API bool x_slice_utf8_split_at(
 XSlice sv,
 uint32_t delim,
 XSlice *left,
 XSlice *right
);

Parameters

XSlice sv
String view input.
uint32_t delim
Delimiter character or codepoint.
XSlice *left
Output: left side view.
XSlice *right
Output: right side view.

Returns

Function-specific result.

Function in stdx_string.h

x_slice_utf8_starts_with_cstr

Checks whether a string view starts with the given C-string prefix.

X_STRING_API bool x_slice_utf8_starts_with_cstr(
 XSlice sv,
 const char *prefix
);

Parameters

XSlice sv
String view input.
const char *prefix
Prefix to match.

Returns

true if the condition holds; false otherwise.

Function in stdx_string.h

x_slice_utf8_substr

Creates a sub-view by byte range from a string view.

X_STRING_API XSlice x_slice_utf8_substr(
 XSlice sv,
 size_t char_start,
 size_t char_len
);

Parameters

XSlice sv
String view input.
size_t char_start
Parameter.
size_t char_len
Parameter.

Returns

Function-specific result.

Function in stdx_string.h

x_slice_utf8_trim

Removes leading and trailing Unicode whitespace (by UTF-8 codepoints).

X_STRING_API XSlice x_slice_utf8_trim(XSlice sv);

Parameters

XSlice sv
String view input.

Returns

Resulting view after the operation.

Function in stdx_string.h

x_slice_utf8_trim_left

Removes leading Unicode whitespace (by UTF-8 codepoints).

X_STRING_API XSlice x_slice_utf8_trim_left(XSlice sv);

Parameters

XSlice sv
String view input.

Returns

Resulting view after the operation.

Function in stdx_string.h

x_slice_utf8_trim_right

Removes trailing ASCII whitespace from a string view.

X_STRING_API XSlice x_slice_utf8_trim_right(XSlice sv);

Parameters

XSlice sv
String view input.

Returns

Function-specific result.