StringBytes
- typeStringBytes
A view into a string indexed by bytes.
- functionget(self: StringBytes, idx: u64) Option[char]
Get the character at byte offset
idx.
- functionlen(self: StringBytes) u64
Get the length of the string in bytes.
- functionlist(self: StringBytes) List[u8]
Returns the list of bytes of this string.
- functionslice(self: StringBytes, start: u64, end: u64) Option[String]
Slice this string based on byte indices.
The byte at index
endis not included in the returned string.This method returns
Noneif eitherstartorendis out of bounds or ifstartis greater thanend. Additionally, this method also returnsNoneif the resulting string would not be valid UTF-8, i.e. when the one of the indices is within a code point.