/*check end character or end string with this function*/
import java.io.*;
public class endswith
{
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.endsWith('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);
}
}
}
import java.io.*;
public class endswith
{
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.endsWith('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