firstLetter static method

String? firstLetter(
  1. String str
)

获取字符串中的第一个字母 Get first letter from string

Implementation

static String? firstLetter(String str) {
  final match = RegExp(r'[a-zA-Z]').firstMatch(str);
  return match?.group(0);
}