[Java] A program that searches a character string and, when the character string is found, displays the character string from the beginning of the line to the character string immediately before the character string to be searched.

less than 1 minute read

I’m making a program that searches a character string in Java and, when the search character string is found, displays the character string from the beginning of the line to just before the search character string. *User input in bold italic Enter the character string by copy and paste

I want to get the results like this. ↓ Screenshot 2020-07-15 19.55.09.png

Current execution result Screenshot 2020-07-15 19.56.33.png

Current source code Screenshot 2020-07-15 19.57.30.png

Supplementary information PC: MAC Editor: Atom