Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

split not working

Status
Not open for further replies.

johnv20

Programmer
Joined
Sep 26, 2001
Messages
292
Location
US
Hi,
can anybody please shed some light on why the split command below is retuning an error message of method not found ?
import java.io.*;
public class reader
{
public static void main(String[] args)
{

try
{
String location = new String();
location = "g:\\perl\\wipscan.txt";
FileReader wipscan = new FileReader(location);
BufferedReader buff = new BufferedReader(wipscan);
boolean eof = false;

while (!eof)
{
String[] ar_Test = line.split("\\~");
if (line == null)
{
eof = true;
}
else
{
String[] ar_Test = line.split("\\~");
}
}
//more code here

Thanks
 
This is most likely due to the wrong version of Java being used. This is new in Java 1.4. So if you are using a Java 1.3 compiler you will get this error at compile time.
Hope this helps :-)
 
Hi,
thanks toolkit - I just realised this as well
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top