INNER CODE UNIT · Dart

isTraditionalChinese

flutterchina/lpinyin · lib/src/chinese_helper.dart:19

  static bool isTraditionalChinese(String c) {
    return chineseMap.containsKey(c);
  }

  /// 判断字符串中是否包含中文
  /// @param str 字符串
  /// @return 包含汉字返回true,否则返回false
  static bool containsChinese(String str) {
    for (int i = 0, len = str.length; i < len; i++) {
      if (isChinese(str[i])) {
        return true;
      }
    }
    return false;
  }

  /// 将单个繁体字转换为简体字
  /// @param c 需要转换的繁体字

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…