• Question

  • Hy

    i use rtl and ltr character since i have english with hebrew

    str1 =heb+"     " ////// fix length ---> for example length =30 , space-->30-len(heb)

    str1 = rtl +str1 /// heb right to left

    str2 =eng+"     " ////// fix length ---> for example length =20, space-->20-len(heb)

    str2 = ltr+str2 /// eng left to right


    the problem that the fixed  length is change since i put hidden charater

    lenght 30 is now more beause hidden rtl/ltr is turn to 32

    my question is :

    i need to export to txt file ascii

    how an i escape special charater but not remove the new direction?


    oren t

    Tuesday, November 12, 2019 8:57 PM

All replies

  • Consider an approach like this:

       string strALL = $"\u200F{heb,-30}\u200E{eng,-20}";

    You can also use string.Format if ‘$’-strings are not available in older versions.

    • Edited by Viorel_MVP Wednesday, November 13, 2019 6:02 AM
    Wednesday, November 13, 2019 6:01 AM
  • Hi oren,

    Thank you for posting here.

    I don't quite understand what you mean. Can you please provide some information for me?

    1. What does str1 and str2 looks like?

    2. What is the hidden character?

    It would be better if you could provide some sample code, that would help us reproduce your problem faster.

    Looking forward to your reply.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Wednesday, November 13, 2019 6:10 AM