jQuery in Action, 3rd edition
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Questions on find find(String[] criteria) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Questions on find find(String[] criteria)" Watch "Questions on find find(String[] criteria)" New topic

Questions on find find(String[] criteria)

lambertlee Li
Ranch Hand

Joined: Dec 15, 2005
Posts: 52
In my assignment, i got instruction on find()method "A non-null value in criteria[n] matches any field value that begins with criteria[n]. (For example, "Fred" matches "Fred" or "Freddy".)".

1) Does this means if user input search criteria of "Fred", I could
just make use of String.startsWith() to search and return the result. But if only make use of
String.startsWith(), the search functionality is quite limited. If I only provide this, will I lose points because of
this? Because it does not perform more complex search, such as wild card search"*Fred*". What do u guys think? Suggestion please.

2)Do we really need the regular expression
to perform search? For example, if user input a search string of "a*b", we could use regexp to perform search.
But that means we have to inforced user to know regexp and to send regexp to backend. Is it a good way?
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
1) yes, that's what it means. No need to do more.
2) My server supports it as a demonstration of how the search mechanism I created is pluggable, but it's not called from the client.

complex searching isn't a requirement (at least for my assignment).

I agree. Here's the link: http://aspose.com/file-tools
subject: Questions on find find(String[] criteria)
It's not a secret anymore!