feat(std): add string splitter
This commit is contained in:
		| @@ -20,5 +20,13 @@ | |||||||
|   (or (= nil s) |   (or (= nil s) | ||||||
|       (= "" s))) |       (= "" s))) | ||||||
|  |  | ||||||
|  | (fn std.s-split [s sep] | ||||||
|  |   (var t {}) | ||||||
|  |   (let [sep (or sep "%s") | ||||||
|  |         re (.. "([^" sep "]+)")] | ||||||
|  |     (each [str (string.gmatch s re)] | ||||||
|  |       (table.insert t str)) | ||||||
|  |     t)) | ||||||
|  |  | ||||||
| std | std | ||||||
| ;;; std.fnl ends here | ;;; std.fnl ends here | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user