68 322
Assignments Done
99%
Successfully Done
In November 2018

Answer to Question #62246 in Java | JSP | JSF for Areeb

Question #62246
In java i know who to get letters from a string. String first = firstName.substring(0,3); This will her first three letters. But how do i get letters starting from 2nd letter to end assuming there is a 2nd letter and onward. Some thing like this String first = firstName.substring(2,end); but the end should be replaced with what?? Thanks
Expert's answer
public class Main {
public static void main(String[] args) {
String s = "Test string";

String sub = s.substring(2, s.length());

System.out.println(sub);
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions