Java Substring
Submissions: 2340   Accuracy:

55.61%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

Given a string S and two integers L and R. Print the characters in the range L to R of the string.

NOTE: Assume zero based indexing.

Input: 
First line of input contains a single integer T, which denotes the number of testcases. T testcases follows, first line of each testcase contains a string S. Second line consists of two integers L and R.

Output: 
Corresponding to each testcase in new line, print the required output.

Constraints:
1 <= T <= 100
1 <= length(S) <= 103
1 <= L <= 800
1 <= R <= 900

Example:
Input:

2
cdbkdub
0 5
sdiblcsdbud
3 7

Output:
cdbkdu
blcsd

Explanation:
Testcase 1:
The characters from 0 to 5 of the given string: cdbkdu

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: S_A
Author: saksham0751


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.