Skip to content

Instantly share code, notes, and snippets.

@lesliearkorful
Created January 8, 2020 01:19
Show Gist options
  • Save lesliearkorful/0bddeab3094d690bf6b8fcd2ed054359 to your computer and use it in GitHub Desktop.
Save lesliearkorful/0bddeab3094d690bf6b8fcd2ed054359 to your computer and use it in GitHub Desktop.
extension PhoneNumberExtension on String {
String get toGHPhoneNumber {
if (this.length != 10) return this;
return '${this.substring(0, 3)} ${this.substring(3, 6)} ${this.substring(6, 10)}';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment