Skip to contents

extract key and values for a character vector

Usage

extract_kv(v, sep = ": ", key_loc = 1, value_loc = 2)

Arguments

v

character vector

sep

separator between key and value

key_loc

key location

value_loc

value location

Value

a named character vector

Examples

extract_kv(c("x: 1", "y: 2"))
#>   x   y 
#> "1" "2"