Check06D - { out.println("No such variable...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.PrintStream; i public class Check06D { public static void main(String[] args) { PrintStream out = System.out; if (args.length < 2) { out.println("Usage: java Check06D <query_string> <variable>"); } else { String commandArgOne = args[0]; String commandArgTwo = args[1]; if (!commandArgOne.contains(commandArgTwo))
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { out.println(&quot;No such variable \&quot;&quot; + commandArgTwo + &quot;\&quot;!&quot;); } else { String store = commandArgOne.split(&quot;&amp;&quot;); for (int i = 0; i &lt; store.length; i++) { if (store[i].contains(commandArgTwo)) { out.println(store[i].substring(store[i].indexOf(&quot;=&quot;) + 1)); } } } } } }...
View Full Document

This note was uploaded on 09/16/2011 for the course CSE CSE 1020 taught by Professor Burton,ma during the Fall '10 term at York University.

Ask a homework question - tutors are online