Format string in arabic language RRS feed

  • Question

  • Hi

    I have a problem with arabic language when i have to concat two arabic string. If these strings contain only arabic words (eg. word1 + word2), the result in a textbox is: word2 + word1. Instead if inside the strings, there some "european" words, the result is different (as I expect): word1 + word2.

    How i have to do, when my CultureUI is ar-SA, regardless of what characters are in the strings, for concatenate word1 + word2 and not word2 + word1?


    Friday, August 2, 2019 8:31 PM


All replies

  • while the following post is for Java, it should apply to C#, too:
    String concatenation containing Arabic and Western characters

    • Marked as answer by Pengo11 Saturday, August 3, 2019 11:15 AM
    Friday, August 2, 2019 9:27 PM
  • Hi EckiS

    Thanks for your reply. My code, is something like this:

    var string1 = "صصص";
    var string2 = "اااال";
    var res = string1 + string2; //WRONG: اصصصااال

    res = string1 + "\u200E" + string2 + "\u200E" //CORRECT: اااالصصص

    res = string1 + "\u200E" + string2 + "\u200E" + "Hi Gianx" //CORRECT: اااالصصصHi Gianx

    I think everything is correct, but I will check with my costomer and if is wrong, i will update this post. So i have used: "Left-to-right mark (U+200E)"

    • Edited by Pengo11 Saturday, August 3, 2019 11:48 AM
    Saturday, August 3, 2019 11:14 AM