Helper function to consume string content from an input stream until a certain target pattern of characters is encountered.
Internal helper function to get the first index of a character in a string.
Internal helper function that returns the slice of a string excluding any preceding or trailing spaces.
Helper function to append an unsigned integer value to a char buffer. It is assumed that there's enough space to write the value.