dotTailMaybeNull property

String? dotTailMaybeNull

Return the string remaining in a string after the last "." in a String, if there is no "." the string itself is returned. If string is null we get null back.

This function can be used to e.g. return the enum tail value from an enum's standard toString method.

Implementation

String? get dotTailMaybeNull {
  if (this == null) {
    return this;
  } else {
    return this?.split('.').last;
  }
}