Structs
Represents a view into an array of UTF-8 chars.
Functions
Returns the number of bytes used by this string slice.
Parameters:
const NSTDStr *const str
- The string slice.
Returns: NSTDUSize len
- The number of bytes in the string slice.
Compares two string slices.
Parameters:
const NSTDStr *const str1
- The first string slice.
const NSTDStr *const str2
- The second string slice.
Returns: NSTDBool is_eq
- True if the two slices are equal.
Creates a new NSTDStr
from an NSTDSlice
. slice->element_size
must be the size of one byte.
Parameters:
const NSTDSlice *const slice
- The UTF-8 encoded byte slice.
Returns: NSTDStr str
- The new string slice.
Creates a new NSTDStr
from a cstring.
Parameters:
const NSTDChar *const cstr
- The cstring.
Returns: NSTDStr str
- The new string slice, excluding the null terminator.
Creates a new NSTDStr
from a cstring.
Parameters:
const NSTDChar *const cstr
- The cstring.
Returns: NSTDStr str
- The new string slice, including the null terminator.
Returns a subslice of str
based on range
.
Parameters:
const NSTDStr *const str
- The string slice.
const NSTDURange *const range
- The range of bytes to make a subslice out of.
Returns: NSTDStr subslice
- The string subslice.
Checks if a string slice is entirely ASCII.
Parameters:
const NSTDStr *const str
- The string slice.
Returns: NSTDBool is_ascii
- True if the string slice is entirely ASCII.
Gets the length of a string slice.
Parameters:
const NSTDStr *const str
- The string slice.
Returns: NSTDUSize len
- The length of the UTF-8 encoded string slice, -1 on error.