1

i want to compare file name in persian ( farsi or arabic ) in assete folder

if (filename.matches("*سلام*\\.jpg")) 
{
    copy(getAssets().open(filename), new File(path) );
    items.add(path);
}

but i think the android doesn't support asian language !!! any budy can tell me something about this problem ???

or how i can compare persian( Farsi or arabic ) string in java ( eclips ) !!???

tnx

4

1 回答 1

1

对我来说,你的正则表达式是错误的。以下作品:

public static void main(String[] args) {
  String filename = "asdf" + "سلام" + "asdf.jpg";
  System.out.println(filename.matches(".*سلام.*\\.jpg")) ;
}

你错过了.之前的*. 不过,不确定这是否是一个错字。

于 2013-04-07T09:43:52.390 回答