TORONTO KIDS COMPUTER CLUB | Markham Saturday 14:00 Java Homework 20.08.29.
18255
post-template-default,single,single-post,postid-18255,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

Markham Saturday 14:00 Java Homework 20.08.29.

04 Sep Markham Saturday 14:00 Java Homework 20.08.29.

Question:
Write a method to get a substring from the string. Please don’t use
the built in substring method, please write your own method for it.

public static String substring(String s, int start_index, int end_index) {
    String returnStr = "";

    // write code here and don't use the s.substring(beginIndex, endIndex) method
    // to get the string. Write your own implementation for it
    // Start writing code from below

    return returnStr;
}

Please check here , if you want to see how the substring method
should work
https://www.tutorialspoint.com/Java-String-substring-Method-ex
ample

Input
Enter string: orange
Enter starting index: 2
Enter ending index: 5

Output
ange
No Comments

Sorry, the comment form is closed at this time.