Function ics::escape_text
source · Expand description
Escapes comma, semicolon and backlash character with a backlash.
This method is only necessary for properties with the value type “TEXT”.
#Example
use ics::escape_text;
let line = "Hello, World! Today is a beautiful day to test: Escape Methods.\n Characters like ; or \\ must be escaped.";
let expected = "Hello\\, World! Today is a beautiful day to test: Escape Methods.\n Characters like \\; or \\\\ must be escaped.";
assert_eq!(expected, escape_text(line));