I have this code
lStock.setText(" Put " + getLoc(i));
At the moment it prints out like this on the GUI:
3I031C
what I want to show now on the screen GUI is:
3I03-1C
I tried testing the split() but I’m confused.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t use the split method since it needs a delimiter, but you’re string doesn’t contain any.
You can try using substring:
But this will only work if the string always have the same length and format.