module(..., package.seeall)

local m_csv = require "helpers.csv"

--[[
	
]]--
function CleanCR (self, s)
	assert(type(s) == "string")
	--LogDebug("[HELPERS.STRING:CleanCR()] --> s: %s", s)
	s = s:gsub("\r", "")
	s = s:gsub("\n", "")
	return s
end

function ltrim (s) return (s or ""):gsub('^%s*','') end
function rtrim (s) return (s or ""):gsub('%s*$','') end
function alltrim (s) return rtrim(ltrim(s)) end

function CapitalizeUpperCase (self, s)
	assert(s)
	local newString, index = s:lower():gsub("^%l", string.upper)
	return newString
end

function ParseString (self, s, fieldSeparator)
	assert(s)
	assert(fieldSeparator)
	return m_csv.ParseCSVLine(s, fieldSeparator)
end
