我有这个自动生成的代码:
public static void main(String[] args) {
JFrame frame = new JFrame("Testing Tool");
// setting close operation
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// sets 500 width and 600 height
frame.setSize(500, 600);
try {
Image image = new ImageIcon("/Project_T/Images/biplane.jpg").getImage();
frame.setIconImage(image);
} catch(Exception e) {
System.out.println("Application icon not found");
}
// uses no layout managers
frame.setLayout(null);
// makes the frame visible
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
如何将这样的代码的第一部分和最后一部分保存到var中?
$code = "k9sdhfkr9235kdh5|fdh4hnchjgrj";
代码始终由该字符(|)分隔,并且代码由随机字符组成,因此有时为16个字符,有时为11等...
$first = "k9sdhfkr9235kdh5";
$last = "fdh4hwshnchjgrj";