Insert integer in arabic string at the beginning

I am trying to add a whole line to an arabic line but will fail

// Arabic String Astr = "سُوْرَةُ الْفَاتِحَة"; // String with Integer -1 num = "-"+1; // Adding Strings r = Astr + num; r = num + Astr; 

output: سُوْرَةُ الْفَاتِحَة-1

Required Conclusion:

 سُوْرَةُ الْفَاتِحَة‎-1 

I want a whole on the right side.

Update: displays this result in a ListBox in visual studio using the Items.Insert() method, so if anyone knows to set up a ListBox, then kindly pass if I ListBox display numbers 1 2 3 4 with each row?

+5
source share
1 answer

Use Unicode LRM (200F)

 string Astr = "سُوْرَةُ الْفَاتِحَة"; var num = "-1"; var LRM = ((char)0x200E).ToString(); var result = Astr + LRM + num; 

and you get: result = "سُوْرَةُ الْفَاتِحَة‎-1"

See: HOW: Formatting Control Characters

LRM ==> Sign from left to right ==> 200E ==> Acts as a Latin character.

+11
source

Source: https://habr.com/ru/post/1203155/


All Articles