https://drive.google.com/file/d/1ba8Oh58ydgAP4rBehvou4qLjlOvUKb2Q/view?usp=drivesdk
public class PracticeSetstring {
public static void main(String[] args) {
//1.Write a java program to convert a string to lowercase.
String name = "YASH NIKHADE";
name = name.toLowerCase();
System.out.println("1.The YASH NIKHADE in lowercase is:"+name);
//2.Write a java program to replace spaces with underscore.
String replace = "hello world";
replace = replace.replace(" ","_");
System.out.println("\n2.When we replace spaces with undercore the hello world become:"+replace);
//3.Write a java program to fill in a letter template which looks like below:
//letter = "Dear <|name|>,thanks a,lot"
//Replace <|name|> with a string(some name)
String letter = "Dear <|name|>,thanks a, lot";
letter = letter.replace("<|name|>","Yash");
System.out.println("\n3."+letter);
//4.Write a java program to dect double and single spacea in a String.
String mystring = "This string contains single and double string";
System.out.println("\n4.The single space in a given string is at "+mystring.indexOf(" "));
System.out.println("4.The double space in a given string is at "+mystring.indexOf(" "));
//5.Write a java program to format the following letter using escape sequence characters.
String format = "Dear Harry, \n\t This java course is nice. \nThanks";
System.out.println("\n\n5.\n"+format);
}
}

