Getting a double out of a string

前端 未结 8 1395
温柔的废话
温柔的废话 2020-12-10 15:15

i have a string containing the following: \"Did It Your Way, 11.95 The History of Scotland, 14.50, Learn Calculus in One Day, 29.95\" is there any way to get the doubles fro

8条回答
  •  渐次进展
    2020-12-10 15:19

    Use Regular Expressions (regex[p]) module of your favourite language, construct a Matcher for the pattern \d+\.\d+, apply the matcher for the input string and you get the matching substrings as capture groups.

提交回复
热议问题