{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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("No such variable \"" + commandArgTwo + "\"!"); } else { String store = commandArgOne.split("&"); for (int i = 0; i < store.length; i++) { if (store[i].contains(commandArgTwo)) { out.println(store[i].substring(store[i].indexOf("=") + 1)); } } } } } }...
View Full Document

{[ snackBarMessage ]}