I am given a vector x which contain these string price intervals

`x <- c("$100-$150","$90-$120","$30-$50")`

how would I write a function that would return a vector containing the min of each interval in numeric form?

`x <- c(100,90,30)`

In addition, how would I write a function that did the same thing but returned the max?