Created
March 16, 2017 15:13
-
-
Save anonymous/69085de6ed235a05cfc59e35cefa12f6 to your computer and use it in GitHub Desktop.
Rust code shared from the playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated to the actual values I wanted.