-- Purely for string returning functions.

local function ArgsToString(inval,nextval,...)
        if NotNilToBool(inval) or NotNilToBool(nextval) then return tostring(inval) .. ArgsToString(nextval,...)
        else return "" end

end

local function ConcatenateValuesWithSeparator(separator,inval,inval2,...)
	if inval ~= nil and inval2 ~= nil then
		if NotToBool(IsStringToBool(inval)) then
			inval = tostring(inval)
		end
		if NotToBool(IsStringToBool(inval2)) then
			inval2 = tostring(inval2)
		end
		return ConcatenateValuesWithSeparator(
			separator,
			inval .. separator .. inval2,
			...
		)
	else
		if inval ~= nil then
			if NotToBool(IsStringToBool(inval)) then
				inval = tostring(inval)
			end
			return inval
		end
	end
end

local function IoRead()
	return io.read()
end

local function ToString(inval)
	return tostring(inval)
end

local function ReadLines(instr,message)
	instr = MatchReplace(instr,"")
	local inval = ""
	print(MatchReplace(message,"Input each line. Ctrl-D on an empty line to stop."))
	while NotNilToBool(inval) do
		inval = io.read()
		instr = instr .. Select(inval,"\n" .. tostring(inval),"")
	end
	return instr

end
