| | |
String
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Sep 2008
Posts: 21
Reputation:
Solved Threads: 1
Hi iwould like to check if there is any function that allows me to take the last 4 char or a String? Or the 1st two char of a String? I require this because i require to have a auto increase product id. Example current productid stops at WA0059. When admin goes to add new product page, WA0060 should be filled into the productid box automatically. THis is to ensure the naming convention is consistent. Any suggestion how to implement this?
This is more of a core java question, So it should have been posted in the Java forum.
Anyways take a look at the javadocs of the String and StringBuffer class you might find what you are looking for there, most probably it is the substring (1,2) menthod..
Anyways take a look at the javadocs of the String and StringBuffer class you might find what you are looking for there, most probably it is the substring (1,2) menthod..
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
•
•
Join Date: Sep 2008
Posts: 21
Reputation:
Solved Threads: 1
Oo my bad reali should be at java forum. Anyway i maaged to solve it thx for the help.
JSP Syntax (Toggle Plain Text)
String t122="AA0001"; char t22=t122.charAt(5); String t32=String.valueOf(t22); char t42=t122.charAt(4); String t312=String.valueOf(t42); String t4112=t312+t32; int t412=Integer.parseInt(t4112);
![]() |
Similar Threads
Other Threads in the JSP Forum
- Previous Thread: how to open pdf files in FireFox through jsp page?
- Next Thread: Some issues with WAR deployment
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web






