Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String inputStrFromFile(String path) {
- boolean isNotCorrect;
- String str = "";
- System.out.println("Считывание строки...");
- try (BufferedReader reader = new BufferedReader(new FileReader(path))) {
- str = reader.readLine();
- if (str.isEmpty()) {
- System.out.println("Ошибка ввода! Строка должна иметь хотя бы 1 символ! Введите строку с клавиатуры.");
- str = readStringFromConsole();
- }
- else {
- System.out.println("Строка для перекодирования: " + str);
- }
- } catch (IOException ioException) {
- isNotCorrect = true;
- }
- return str;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement