[PATCH v2 04/71] lib: Add a function to split a string into substrings