import java.io.*;
public class startwith
{
public static void main(String []args)
{
String str;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter first String ");
str=cin.readLine();
if(str.startsWith('j'))
{
System.out.println(str+" is start with given character");
}
else
{
System.out.println(str+" is does not start with given character");
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}
public class startwith
{
public static void main(String []args)
{
String str;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter first String ");
str=cin.readLine();
if(str.startsWith('j'))
{
System.out.println(str+" is start with given character");
}
else
{
System.out.println(str+" is does not start with given character");
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}
No comments:
Post a Comment