Skip to content

Instantly share code, notes, and snippets.

Created March 16, 2017 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/69085de6ed235a05cfc59e35cefa12f6 to your computer and use it in GitHub Desktop.
Save anonymous/69085de6ed235a05cfc59e35cefa12f6 to your computer and use it in GitHub Desktop.
Rust code shared from the playground
fn main() {
let raw_string ="header1,header2,header3
r1v1,r1v2,r1v3
r2v1,r2v2,r2v3";
let lines = raw_string.lines();
let mut main_vec = Vec::new();
for row in lines {
let trimmed = row.trim();
let values: Vec<_> = trimmed.split(',').collect();
main_vec.push(values);
}
print!("{:?}", main_vec);
}
@marcusjwhelan
Copy link

Updated to the actual values I wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment