Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

rust create hashmap from delimited data in string

use std::collections::HashMap;

let states: HashMap<_, _> = "AZ CA ID IN MA OK PA VA"
    .split(' ')
    .zip(
        "Arizona California Idaho Indiana Massachusetts Oklahoma Pennsylvania Virginia"
            .split(' '),
    )
    .collect();    
 
PREVIOUS NEXT
Tagged: #rust #create #hashmap #delimited #data #string
ADD COMMENT
Topic
Name
7+3 =