Writing a function to find length of given input string.

 

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;
      }
    }
  }
}

Google Script for Data Entry Form in Google Spreadsheet

// function to validate the entry made by user in user form function validateEntry (){ // declare a variable and referernece of active goog...