summaryrefslogtreecommitdiffstats
path: root/lib/format.lua
diff options
context:
space:
mode:
authorMike Mason <ms13sp@gmail.com>2007-12-13 13:53:10 +0000
committerMike Mason <ms13sp@gmail.com>2007-12-13 13:53:10 +0000
commitf4075701ea0274ec47d321cef3d0f202cc7b6b8e (patch)
treee30d25c93ff711a4c1007fce5afdff98800eb64a /lib/format.lua
parentc2dcd9a6e48e4d92d3f4c16ca5c1ae1d519b40b5 (diff)
downloadacf-core-f4075701ea0274ec47d321cef3d0f202cc7b6b8e.tar.bz2
acf-core-f4075701ea0274ec47d321cef3d0f202cc7b6b8e.tar.xz
Changing password-model to use format. Adding function to format.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@423 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/format.lua')
-rw-r--r--lib/format.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/format.lua b/lib/format.lua
index 4e483de..60205af 100644
--- a/lib/format.lua
+++ b/lib/format.lua
@@ -94,6 +94,19 @@ function cap_begin_word ( str )
return data
end
+--give a table of ipairs and turn it into a string
+
+function ipairs_to_string ( t )
+ for a,b in ipairs(t) do
+ if a == 1 then
+ d = b
+ else
+ d = d .. "\n" .. b
+ end
+ end
+ return d
+end
+
-- This code comes from http://lua-users.org/wiki/SplitJoin
-- -- example: format.table_to_string(", ", {"Anna", "Bob", "Charlie", "Dolores"})