Class Bidi
Provides BIDI processing for Arabic, Persian, Urdu and Hebrew.
Please see Example_04.
public static class Bidi
- Inheritance
-
Bidi
- Inherited Members
Methods
IsArabic(int)
Returns true if the character is in the Arabic Unicode block, U+0600 to U+06FF.
public static bool IsArabic(int ch)
Parameters
chint
Returns
JoinsBackward(int)
Returns true if the Arabic character joins the character before it.
public static bool JoinsBackward(int ch)
Parameters
chint
Returns
JoinsForward(int)
Returns true if the Arabic character joins the character that follows it.
public static bool JoinsForward(int ch)
Parameters
chint
Returns
ReorderVisually(string)
Reorders the string so that Arabic and Hebrew text flows from right to left while numbers and Latin text flows from left to right. The string is laid out as a right to left line with left to right text nested in it one level deep. Spaces, punctuation and brackets take their direction from the text around them, as in the Unicode Bidirectional Algorithm. Brackets in right to left text are replaced with their mirror images, each after a right-to-left mark (U+200F). Page does not draw the mark, and gives the bracket after it the bracket it stands for as actual text, so the text copied from the page has the brackets that were typed.
public static string ReorderVisually(string str)
Parameters
strstringThe input string.
Returns
- string
The reordered string.
ReorderVisually(string, int, int)
Reorders the string like ReorderVisually(string), and returns the
part of the result that comes from the characters of the string at
the indexes from from, inclusive, to
to, exclusive, counted in UTF-16 code units as
Substring counts them. The letters are shaped in the context of the
whole string, so a word that is broken between two lines keeps its
joined forms at the break when each line is made this way.
public static string ReorderVisually(string str, int from, int to)
Parameters
strstringThe input string.
fromintThe UTF-16 index of the first character to return.
tointThe UTF-16 index after the last character to return.
Returns
- string
The reordered part of the string.