0% found this document useful (0 votes)
4 views2 pages

Bindhu String Java 1

The document contains a Java program that extracts a substring from a user-provided string based on specified starting and ending indices. It prompts the user to enter a string and the indices, then prints the extracted substring. The program utilizes the Scanner class for input and the substring method for extraction.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Bindhu String Java 1

The document contains a Java program that extracts a substring from a user-provided string based on specified starting and ending indices. It prompts the user to enter a string and the indices, then prints the extracted substring. The program utilizes the Scanner class for input and the substring method for extraction.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.util.

*;
class StringExtract
{
public static void main(String[]args)
{
System.out.println("2322j1332");
System.out.println("BINDHUJA B");
String s;
Scanner ob=new Scanner(System.in);
System.out.println("enter the string:");
String input=ob.nextLine();
System.out.println("enter the starting index:");
int start=ob.nextInt();
System.out.println("enter the ending index:");
int end=ob.nextInt();
String extract=input.substring(start,end);
System.out.println("extracted string:"+extract);
}
}

You might also like