From c17faf4b793db95a6957fcf5af7b73acaee2dc76 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 25 Sep 2008 17:42:43 +0000 Subject: Removed split and join libraries. Join is handled by table.concat. Split is handled by format.string_to_table. git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1515 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/split.lua | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 lib/split.lua (limited to 'lib/split.lua') diff --git a/lib/split.lua b/lib/split.lua deleted file mode 100644 index f3e2e95..0000000 --- a/lib/split.lua +++ /dev/null @@ -1,31 +0,0 @@ ---[[ - module for splitting a string to an array -]]-- - -module (..., package.seeall) - --- This code comes from http://lua-users.org/wiki/SplitJoin - --- Split text into a list consisting of the strings in text, --- separated by strings matching delimiter (which may be a pattern). --- example: strsplit(",%s*", "Anna, Bob, Charlie,Dolores") -return function (delimiter, text) - local list = {} - local pos = 1 - -- this would result in endless loops - if string.find("", delimiter, 1) then - error("delimiter matches empty string!") - end - while 1 do - local first, last = string.find(text, delimiter, pos) - if first then -- found? - table.insert(list, string.sub(text, pos, first-1)) - pos = last+1 - else - table.insert(list, string.sub(text, pos)) - break - end - end - return list -end - -- cgit v1.2.3