Question: The user will be able to give a string and an index position in the string as arguments to the method. The method will return
The user will be able to give a string and an index position in the string as arguments to the method. The method will return the character located at that index position in the string including white spacesComplete the method public static char returnTheCharacterAtTheGivenIndex to complete this task Task : The user will be able to give a string and an index position in the string as arguments to the method. The method will return the substring starting at that index position in the string including white spaces to the end of the string. Complete the method public static String returnTheSubStringStartingAtTheGivenIndex to complete this task.
return the character at the given index in word
public static char returnTheCharacterAtTheGivenIndexString word, int index
return ;
return the substring starting from the given index
public static String returnTheSubStringStartingAtTheGivenIndexString word, int index
return ;
Please write a code in regex to follow to tasks given and return the answer to a driver. Below are the strings being checked System.out.printlnStringRegExAssignmentreturnTheCharacterAtTheGivenIndex;
System.out.printlnStringRegExAssignmentreturnTheCharacterAtTheGivenIndexCSCI; C
System.out.printlnStringRegExAssignmentreturnTheCharacterAtTheGivenIndexChicken Wrap", ; white space
System.out.printlnStringRegExAssignmentreturnTheSubStringStartingAtTheGivenIndex;
System.out.printlnStringRegExAssignmentreturnTheSubStringStartingAtTheGivenIndexCSCI; CSCI
System.out.printlnStringRegExAssignmentreturnTheSubStringStartingAtTheGivenIndexChicken Wrap", ; white spaceWrap
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
