iniciais static method

String iniciais(
  1. String? pnome
)

Implementation

static String iniciais(String? pnome) {
  String strInicial = "";

  if (pnome == null) {
    return "";
  } else if (pnome.isEmpty) {
    return "";
  } else {
    var vName = pnome.split(" ");
    for (var i = 0; i < vName.length; i++) {
      if (i > 2) {
        break;
      } else {
        if (vName[i].isNotEmpty) {
          strInicial += vName[i].substring(0, 1);
        }
      }
    }
  }

  return strInicial;
}