[PATCH v3 04/70] lib: Add a function to split a string into substrings