string manipulations with operators and string methods code example
Example: String manipulations
boolean eq = name.equals(anotherName);
String fruit = "Apple";
int position = fruit.indexOf("pp");
int length = fruit.length()
String sub = fruit.substring(1, 4);
String upper = fruit.toUpperCase();
boolean empty = fruit.isEmpty();
boolean blank = fruit.isBlank();
boolean startsWith = fruit.startsWith("app");
boolean endWith = fruit.endsWith("le");
boolean containsDoubleP = fruit.contains("pp");
String part = fruit.substring(0, 2).toLowerCase();