import java.io.*;
public class trim
{
public static void main(String []args)
{
String str,str_2;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter any String ");
str=cin.readLine();
System.out.println("Your entered string is = "+str);
str_2=str.trim();
System.out.println(str_2);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
public class trim
{
public static void main(String []args)
{
String str,str_2;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter any String ");
str=cin.readLine();
System.out.println("Your entered string is = "+str);
str_2=str.trim();
System.out.println(str_2);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
No comments:
Post a Comment