Escape the content of self for inclusion in a CSV document

Property definitions

csv :: csv $ Text :: escape_to_csv
	# Escape the content of `self` for inclusion in a CSV document
	private fun escape_to_csv(sep_char, delim_char: Char, eol: String): String do
		var add_sp = chars_to_escape_csv(sep_char, delim_char, eol)
		if add_sp == 0 then return to_s
		var bf = new Buffer.with_cap(add_sp + byte_length)
		bf.add '"'
		for i in [0 .. length[ do
			var c = self[i]
			if c == delim_char then
				bf.add c
			end
			bf.add c
		end
		bf.add '"'
		return bf.to_s
	end
lib/csv/csv.nit:19,2--34,4