Java Scanner Usage queryStr(Scanner in, String msg)

Here you can find the source of queryStr(Scanner in, String msg)

Description

query Str

License

Open Source License

Declaration

public static String queryStr(Scanner in, String msg) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Scanner;

public class Main {
    public static String queryStr(Scanner in, String msg) {
        System.out.printf("%s", msg);

        String response = in.nextLine();
        if (response.length() == 0) {
            System.out.printf("Please enter a valid string!\n");
        }// w w w .j av a 2s .  c  o  m
        return response;
    }
}

Related

  1. parseTime(String input)
  2. pathTokenList(String path)
  3. pressEnterToContinue()
  4. processLine(String aLine)
  5. queryMenu(Scanner in, String msg, LinkedList options)
  6. removeFirstNLines(String text, int n)
  7. removeIndexes(String xpath)
  8. removeNLinesForwardsFromStringMatch(String text, String match, int n)
  9. selectProject(List projectList)