1.
Write a Java Applications to extract a portion of a character string and print the extracted
string.
Aim: Extracting a portion of a character string and print the extracted string.
Step No. Instructions
1 Start
2 Declare a string variable s1 to store a string received from keyboard
3 Declare another string variable s2 to store a set of extracted characters from string s1
4 Declare 2 integer variables namely, a and b to store the Starting Position and Ending
Position for Extraction
5 Read a string from keyboard using readLine( ) function
6 Convert the string into integer using parseInt( ) method and store it in the variable a
7 Read an another string from keyboard using readLine( ) function
8 Convert the string into integer using parseInt( ) method and store it in the variable b
9 Find the number of characters from a to b in s1 using substring( ) method of String
class and store them in s2
10 Print s2 using println( ) method
11 Save the Java code in the name of [Link]
12 Compile the Java code using javac
13 Run the Java code using java
14 Stop