Mohammad Qurashi Mohammad Qurashi -4 years ago 314
C# Question

incorrect right to left concatenation english and Arabic

I'm trying to concatenate an English string with Arabic string

string followUpFormula = "FIF";
string renewAbbreviation = "ع.ت" ;
string abbreviation = followUpFormula +"-"+ renewAbbreviation;
var result = 10 + "/" + abbreviation + "/" + 2016;

the result is 10/FIF-ع.ت/2016
but i want to display them like this: 10/FIF-ع.ت/


how can I do that?

Answer Source

Couple of additions to your code

string followUpFormula = "FIF";
string renewAbbreviation =  "ع.ت" ;
var lefttoright = ((Char)0x200E).ToString();
var result = 10 + "/" + abbreviation + lefttoright + "/" + 2016;

Char 0x200E is a special character that tells the following text to read left to right see here for more information on the character.

Char 0x200F switches to a right to left format.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download