hasPersian static method

bool hasPersian(
  1. String input, {
  2. bool complex = false,
})

Checks if the input string contains any Persian characters @param input The string to check @param complex Whether to use complex Persian character set @returns bool True if input contains Persian characters Example: PersianTools.hasPersian("Hello سلام") => true

Implementation

static bool hasPersian(String input, {bool complex = false}) {
  final String faRegExp = complex ? _faComplexText : _faText;
  return RegExp("[$faRegExp]").hasMatch(input);
}