Good day.

There is a text variable. How can you determine whether the text is entered in Cyrillic or Latin ? In C #, you can do this by checking the codes of each character.

thank

  • Are you satisfied with the "at least one non-Latin character" check? You can set intervals in msdn.microsoft.com/en-us/library/ms179859.aspx [^a-zA-Z] give the desired result, you can of course add more digits and punctuation marks with a space - Mike
  • Well, or as an option, do not believe, check character codes. msdn.microsoft.com/en-us/library/ms177545.aspx - Mike
  • Lines like АБВZXC to refer to both classes, or none? - i-one
  • if there is at least 1 Cyrillic character, then it is already Cyrillic - Leonard Bertone

1 answer 1

if there is at least 1 Cyrillic character, then it is already Cyrillic

Then something like this:

 declare @string nvarchar(1000) = N'Привет'; if @string like N'%[А-Яа-я]%' print 'cyrillic'; else print 'latin'; 
  • Thank! Works - Leonard Bertone