How to force a piece of text to be 'direction ltr' inside a 'direction rtl' paragraph

后端 未结 3 1237
-上瘾入骨i
-上瘾入骨i 2021-02-02 09:47

So, phone numbers are always ltr (left to right).

Working on a multilingual website I need to insert a phone number (with a \'+\' prefix and numbers separated by \'-\')

3条回答
  •  青春惊慌失措
    2021-02-02 10:26

    You can use a unicode directionality marker character just before the + sign to give the algorithm the hint it needs.

    These are:

    LTR: 0x200E
    RTL: 0x200F
    

    So:

    Please call to ‏+44-123-321 for some help

    See this SO answer for more details.

提交回复
热议问题