Scanner method using

610 단어 자바urlScanner
//Demonstrates the use of Scanner to read file input and parse it using alternative delimiters
import java.util.Scanner;
import java.io.*;
public class URLDissector {
public static void main(String []args)throws IOException
{
	String url;
	Scanner fileScan,urlScan;
	fileScan=new Scanner(new File("/text"));
	while(fileScan.hasNext()){
		url=fileScan.nextLine();
		System.out.println("URL:"+url);
		urlScan=new Scanner(url);
		urlScan.useDelimiter("/");
		while(urlScan.hasNext())
			System.out.println(" "+urlScan.next());
		System.out.println();
	}
}
}

좋은 웹페이지 즐겨찾기