import java.util.Scanner;
import java.util.function.Function;
class StringLengthFunction {
public static void main(String[] args) {
Function<String, Integer> f = s -> s.length();
Scanner sc = new Scanner(System.in);
System.out.println("Enter a String");
String str = sc.nextLine();
while (true) {
if (str.equals("0")) {
break;
}
System.out.println("The length of String is : " + f.apply(str));
System.out.println("--------------------------------------------");
System.out.println("Enter another String");
System.out.println("Press 0 to exit");
str = sc.nextLine();
if (str.equals("0")) {
break;
}
}
}
}