Persian Tools - v4.0.3
    Preparing search index...

    Function toPersianChars

    • toPersianChars

      Description:

      • Replaces common Arabic characters (ي, ى, ك) with their Persian equivalents (ی, ی, ک).
      • Preserves Arabic text inside double-curly-braces ({{ ... }}) by skipping those segments entirely.
      • Also includes diacritic replacements (e.g., ً, ٌ, ٍ, etc.) to standardize the text.

      Parameters

      • str: string

        The input string that may contain Arabic forms.

      Returns string

      A cleaned string with Persian characters replaced appropriately.

      Example:

        toPersianChars("عبدالله بن عبدالعزیز");
      // => "عبدالله بن عبدالعزیز" (unchanged if there's nothing to replace)

      toPersianChars("كشتى ىيكى {{ARABIC|كلمه}}");
      // => "کشتی یکی {{ARABIC|كلمه}}" // 'كلمه' inside {{ }} is preserved

      toPersianChars