Reverse characters in string with mixed Left-to-right and Right-to-left languages using SQL?

前端 未结 3 1980
萌比男神i
萌比男神i 2021-02-19 15:06

I have string values in my table which includes Hebrew characters (or any R-T-L language for this case) and English ones (or numbers).

The problem is that the English ch

3条回答
  •  你的背包
    2021-02-19 15:19

    You can use ASCII function in SQL Server for getting the ascii value of characters in the text field in DB. Once you get the ascii value, compare that against the valid range of english visible characters and numerals. Anything else can be considered as Hebrew character.

    Also there exists REVERSE function automatically in SQL Server for reversing the string as required.

    Following link has some sample code.

    http://www.sqlservercurry.com/2009/09/how-to-find-ascii-value-of-each.html

提交回复
热议问题