formatAtSign method

String formatAtSign(
  1. String atsign
)

Returns null if atsign is null else the formatted atsign. atsign must be non-null.

Implementation

String formatAtSign(String atsign) {
  atsign = atsign.trim().toLowerCase().replaceAll(' ', '');
  atsign = !atsign.startsWith('@') ? '@$atsign' : atsign;
  return atsign;
}