Use of Searching Algorithm

I am trying to write a program that will have a database of Strings stored in a .dat file that will allow the end-user to search for a specific substring within the file. ie. If one of the Strings stored in the file was How to Implement an Array and the user searched for implementing arrays the programs search algorithm would return that String. Is there any way in Java to do something like this?

[406 byte] By [pocniba] at [2007-10-2 6:54:35]
# 1

Take a look at the String documentation:

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html

especially at the indexOf-methods.

For reading from a file, see:

http://java.sun.com/docs/books/tutorial/essential/io/

For storing objects in an array, see:

http://java.sun.com/docs/books/tutorial/java/data/arrays.html

If you have a specific question about one of the links, try posting it in the Fundamentals forum:

http://forum.java.sun.com/category.jspa?categoryID=5

Good luck.

prometheuzza at 2007-7-16 20:22:22 > top of Java-index,Other Topics,Algorithms...