Skip to content

Commit 71575c2

Browse files
authored
Create JavaSubstring.java
1 parent 5744b77 commit 71575c2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

JavaSubstring.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import java.util.Scanner;
2+
public class JavaSubstring
3+
{
4+
public static void main(String[] args)
5+
{
6+
Scanner sc = new Scanner(System.in);
7+
System.out.println("Enter the String: ");
8+
String S = sc.nextLine();
9+
System.out.println("Enter the Starting Point: ");
10+
int start = sc.nextInt();
11+
System.out.println("Enter the Ending Point: ");
12+
int end = sc.nextInt();
13+
System.out.println("The Substring is: ");
14+
System.out.println(S.substring(start, end));
15+
}
16+
17+
}

0 commit comments

Comments
 (0)