Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

detect Hebrew letters in strings

Tags:

java

string

I am trying to write some code that changes files with hebrew letters in them to valid english names insted, but i am having problems understading how to detect those files, i built a filter for listfiles function.

Also i have searched online and i couldn't find an answer but this one:

How to tell if a string contains characters in Hebrew using PHP?

but its not java, its php. any ideas?

like image 584
user3256396 Avatar asked Dec 15 '22 02:12

user3256396


1 Answers

To test that the String str contains Hebrew letters use:

str.matches (".*[א-ת]+.*")

returns true if str contains Hebrew letters.

like image 148
Israel Shapira Avatar answered Dec 30 '22 14:12

Israel Shapira