We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Strings
- Java Substring
- Discussions
Java Substring
Java Substring
Sort by
recency
|
432 Discussions
|
Please Login in order to post a comment
import java.util.Scanner; public class Sub_string {
Very Simple. it's just add one line logic and so on.
public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.next(); int start = in.nextInt(); int end = in.nextInt(); String result = s.substring(start,end); System.out.println(result); }
The code is optimized to meet the Constraints:
import java.util.; import java.util.regex.;
public class Solution {
}
Very Easy to solve the problem...!!!!
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
public class Solution {
}