For example, I can get the begin line and end line, but how do I get the source code between begin line and end line. for the example code here.
String[] cmds =new String[2];
String OS = System.getProperty("os.name");
if (OS.startsWith("Windows")) {
cmds[0]="cmd";
cmds[1]="/c";
}
else {
cmds[0]="/bin/sh";
cmds[1]="-c";
}
try {
Process p = Runtime.getRuntime().exec(cmds);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I want to get the code below, that is the definition related to cmds.
String[] cmds =new String[2];
String OS = System.getProperty("os.name");
if (OS.startsWith("Windows")) {
cmds[0]="cmd";
cmds[1]="/c";
}
else {
cmds[0]="/bin/sh";
cmds[1]="-c";
}