0% found this document useful (0 votes)
8 views1 page

STR - Java HH

Uploaded by

Murugan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

STR - Java HH

Uploaded by

Murugan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import java.io.

*;
class str
{
public static void main(string args[])throws IOException
}|
int choice,a;
DataInputStream in =new Data Input Stream(system.in);
do
{
System.out.println("1.lengthln 2.uppercaseln 3.concatinationln 4.insertln
5.replaceln 6.append");

System.out.println("Enter the string");


String s1=in.readLine();
String Buffer s2=new String Buffer (s1);
System.out.println("Enter the choice");
Choice=Integer.parseint(in.readLine());
switch(chocie)
{
case 1:
System.out.println("length of the give string is:"+s1.length());
break;
case 2:
System.out.println("uppercvase of the give string is:"+s1.to
upperCase());\
break;
case 3:
System.out.println("coneatilation of the qiven
is:"+s1.concat("madurai"));
break;
case 4:
System.out.println("insert of the given string
is:"+s2.insert(3,"madurai"));
break;
case 5:
System.out.println("replace of the given string is:"+s2
replace(3,6,"hello"));
break;
case 6:
System.out.println("append of the given string is:"+s2.append("msp"));
break;
}
System.out.println("do you want continue press 1");
a=Integer.Parse Int(in.read line());
}
while(a==1);
}
}

You might also like