destring function

Convert character vector to numeric, ignoring irrelevant characters.