stringToNumbers function

List<double> stringToNumbers(
  1. String numString
)

Implementation

List<double> stringToNumbers(String numString) {
  numString = numString.replaceAll('\n', ',');
  numString = numString.replaceAll('-', ',-');
  numString = numString.replaceAll('e,-', 'e-');

  return [
    for (var s in numString.split(RegExp('[ ,]')))
      if (s.isNotEmpty) double.parse(s)
  ];
}