Advertisements
Advertisements
प्रश्न
Write a statement in Java to extract the last four characters from the word "SIMPLICITY".
अति संक्षिप्त उत्तर
Advertisements
उत्तर
System.out.println("SIMPLICITY".substring(6));
Explanation:
The substring() function extracts a segment of a string from start to end index-1. "SIMPLICITY".substring(6) extracts characters from index 6 to the end.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2021-2022 (March) Official Board Paper
