From f4075701ea0274ec47d321cef3d0f202cc7b6b8e Mon Sep 17 00:00:00 2001 From: Mike Mason Date: Thu, 13 Dec 2007 13:53:10 +0000 Subject: 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 --- lib/format.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/format.lua') 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"}) -- cgit v1.2.3