[−][src]Function rustsv::parse
pub fn parse<A>(content: A, delimiter: char, has_headers: bool) -> Contentⓘ where
A: Into<String>,
Parses the provided String into an instance of Content
The method will deconstruct the provided data, turning it into a special, serialization free structure Content
content
the CSV data to parse
delimiter
The delimiter used in the data, for example a pipe (|
) or a tab (
)
has_headers
If the data's first line contains the titles of each column or not
Examples
Basic usage:
use rustsv::prelude::*; // Create our input data let input: String = "surname,initial,address,phone number\ Smith,A,\"14 Made up Drive, Made up City, Ohio\",216-235-3744\ Doe,J,\"15 Fake Street, Phonyville, Texas\",210-214-5737".to_string(); // Parse the `input` into `Content` let content: Content = parse(input, ',', true);