假设我有以下字符串:
something1: +12.0 (some unnecessary trailing data (this must go))
something2: +15.5 (some more unnecessary trailing data)
something4: +9.0 (some other unnecessary data)
something1: +13.5 (blah blah blah)
我该如何将它简化为
+12.0,+15.5,+9.0,+13.5
在bash中怎么做?
listOfStuff mkString ", "
,或者Haskell的intercalate ", " listOfString
。 - F. P. Freely