String with hebrew letters

Shay

Well-Known Member
Licensed User
Longtime User
Hi

is there a way to know if string contains (even first letter is enough) hebrew letters?

Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Here:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   Log(ContainsHebrewChar("sdfhkjls dfhkjshdfkjsd fhkjsd hf"))
   Log(ContainsHebrewChar("fwehjkfl wefjwefkljwe fkl אראל"))
End Sub

Sub ContainsHebrewChar(s As String) As Boolean
   For i = 0 To s.Length - 1
      Dim codePoint As Int
      codePoint = Asc(s.CharAt(i))
      If (codePoint >= 0x590 AND codePoint <= 0x5ff) OR (codePoint >=0xFB1D AND codePoint <= 0xFB4F)Then
         Return True
      End If
   Next
   Return False
End Sub
The unicode range was found here: Hebrew alphabet - Wikipedia, the free encyclopedia
 
Upvote 0
Top