hasPersian function

bool hasPersian(
  1. String input, [
  2. bool isComplex = false
])

Check is the input string includes Persian alphabet or not returns true if the input is matched with Farsi char dataset RegExp, if not returns false

Implementation

bool hasPersian(String input, [bool isComplex = false]) {
  var faRegExp = isComplex ? faComplexText : faText;
  return RegExp('[$faRegExp]').hasMatch(input);
}