java - Using getParameterValues and Arrays -


so getting parameters page, , putting them array, taking items in array , running substring method on them:

string[] edit = request.getparametervalues("editid"); // system.out.println(edit); string editdel = "";   if (edit != null) {      (int = 0; < edit.length; ++i) {         string lf = edit[i];         editdel = lf.substring(0, lf.length() - 2);     } } else { editdel = "0"; } // system.out.println(editdel); 

so example if pass params 3lf , 12lf previous page, system prints [ljava.lang.string;@520 variable edit, , prints 12 variable editdel. need store editdel in array, because should getting both 12 , 3 editdel variable

put editdel print statement inside loop

   (int = 0; < edit.length; ++i) {     string lf = edit[i];     editdel = lf.substring(0, lf.length() - 2);       system.out.println(editdel);     } } else { editdel = "0"; } 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -