Skip to main content

push_field

Function push_field 

Source
pub fn push_field(out: &mut String, text: &str, separator: char)
Expand description

Appends text as one field, quoted when it holds separator, a quote or a line break.

let mut line = String::new();
ravenrs_core::csv::push_field(&mut line, "Smith, \"J\"", ',');
assert_eq!(line, "\"Smith, \"\"J\"\"\"");