About String
Hi,
If I have:
String strSearch = txtf.getText();
String str = elseString;
str.startsWith(strSearch);
I know to fined start with, but it is not case sencitive.
I don't anderstend how to use this:
str.matches("(?i)'"+strSearch+"'.*");
why I have (?i) ?
Thanks
Yael
[383 byte] By [
yael800a] at [2007-11-26 12:23:07]

> But why don't use str.matches? it is not good method?
"matches" means that you're trying to find out whether a given String applies to a certain pattern. All you want to now is whether some substring exists. matches() would not only be overkill, but also obviously more difficult to understand (you prove it yourself) and slower.
it is not that matches() is not a good method, it is just that you must undestanding how regular expressions work. If you have a hard time understanding it, find something similar and easier to understand. It will also help you when you need to debug your codes.