View Single Post
  #8 (permalink)  
Old 03-31-2008, 08:56 PM
dav9999 dav9999 is offline
Member
 
Join Date: Mar 2008
Posts: 4
dav9999 is on a distinguished road
how would I include this code in the above?? I tried it like this, but it didn't work

import java.io.*;

public class SplittingText {
public static void main(String[] args) {
System.out.println("Which Street?:");

// Opens up standard input
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String target = null;
String path = "splittingText.txt";
try {
target = br.readLine();
} catch (IOException ioe) {
System.out.println("IO error reading command line input");
System.exit(1);
}
String[] s = line.split("\\=");
System.out.println("value for " + target +
" is: " + s[1]);
br.close();
} catch(IOException e) {
System.out.println("read error: " + e.getMessage());
}
}
Reply With Quote