removeCaracteres static method

String removeCaracteres(
  1. String data
)

Converte o formato brasileiro DDMMAAAA para UTC AAAAMMDD.

Implementation

static String removeCaracteres(String data) {
  final novaData = StringBuffer();

  for (var index in data.runes) {
    final numero = int.tryParse(String.fromCharCode(index));
    if (numero != null) {
      novaData.write(numero);
    }
  }

  return novaData.toString();
}