1).
Java Program for string Handling Functions
import [Link];
public class StringHandlingProgram {
public static void main(String[] args) {
Scanner scanner = new Scanner([Link]);
// Get input from the user
[Link]("Enter a string: ");
String input = [Link]();
// Display the length of the string
[Link]("Length of the string: " + [Link]());
// Convert the string to uppercase
String uppercase = [Link]();
[Link]("Uppercase string: " + uppercase);
// Convert the string to lowercase
String lowercase = [Link]();
[Link]("Lowercase string: " + lowercase);
// Check if the string contains a specific substring
[Link]("Enter a substring to search for: ");
String substring = [Link]();
if ([Link](substring)) {
[Link]("String contains the substring.");
} else {
[Link]("String does not contain the substring.");
}
// Get the index of a specific character in the string
[Link]("Enter a character to search for: ");
char ch = [Link]().charAt(0);
int index = [Link](ch);
if (index != -1) {
[Link]("Character found at index " + index);
} else {
[Link]("Character not found in the string.");
}
[Link]();
}
}