initials method

String initials(
  1. String fullName
)

Implementation

String initials(String fullName) {
  //
  final names = fullName.split(' ');

  final initials = StringBuffer();

  for (final name in names) {
    if (name.isEmpty) {
      continue;
    }
    initials.write(name[0]);
  }
  return initials.toString().toUpperCase();
}