This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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?