I am looking for a way to input a sentance as a single string, how would I do this? I could also just use a file as an input (.txt), but I don t know how to approach it.
我基本上想无视空间划界,需要帮助确定如何确定
我迄今所做的事情:
Scanner input = new Scanner(System.in);
Random randomGenerator = new Random();
int rand = randomGenerator.nextInt(10)+1;
System.out.print("Enter code to be encoded. End the text with a semicolon(;): ");
String in = input.next();
System.out.println();
System.out.println("Confirmation: Encode the following text? y to accept, n to decline");
System.out.println(in);
Edit: added src I m working on an encoder for me and some friends, and want to do sentances at a time instead of words at a time. Yes, they will end with a period.