String Day - 05
String Day - 05
String Day - 05
System.out.println(s.substring(5, 6));
System.out.println(s.substring(5,6).isEmpty());
System.out.println(s.substring(5,5).isBlank());
System.out.println(s.substring(5,6).isBlank());
System.out.println(s.startsWith("hello"));
System.out.println(s.endsWith("everyone"));
System.out.println(s.startsWith("h"));
System.out.println(s.endsWith("e"));
System.out.println(s.startsWith("e"));
}
}
___________________________________________________________________________________
__________________________
/*
* Program to read a string from the user
* and find whether the string has
* a substring "everyone" or not
* if it is there display the character "everyone"
* in the case it present in the user passing
* string
*
* InPUT as : everyone
* Output as : everyone word is present
*
* Input as :EveryOne
* Output as : EveryOne word is present
*
* Input as : Hello
* Output as : Everyone word is not present
*
*/
Que- Write a java program to take the file name as argument,if it is a text file
print the file is text file ,else print file is not a text file.
Note: What form user will pass the value as ABC.txt or abc.txt
in that form only return the result to the user.
-------------------------------------------------------------------
Que- Write a program to take array of file name as fileName ,
return an array which have only the file name as text filename