A program that searches for a character string, 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.

I am making a program that searches for 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.

I want to get the execution result like this. ↓ スクリーンショット 2020-07-15 19.55.09.png

Current execution result スクリーンショット 2020-07-15 19.56.33.png

Current source code スクリーンショット 2020-07-15 19.57.30.png

Supplementary information PC: MAC Editor: Atom

Recommended Posts

A program that searches for a character string, 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.
Character duplicate count (substring)
[Java] How to erase a specific character from a character string
A program that searches for a character string, 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.
Search for English words from terminal
[Java] Divide a character string by a specified character
[Java] Character judgment / character string formatting (AOJ11 --character count)
Deletes after the specified character from the character string
How to make a judgment method to search for an arbitrary character in an array
[Android] How to convert a character string to resourceId
I tried to make a program that searches for the target class from the process that is overloaded with Java
A trick when you want to insert a lot of line breaks and tabs when substituting a character string
[Java] When putting a character string in the case of a switch statement, it is necessary to make it a constant expression
A memo of the program that allows you to realize that the probability of dice rolling is about 1/6
String Replacement of the case where the regular expression * of the character string search condition contains a line break.
I tried to express the result of before and after of Date class with a number line
[Java beginner] Conversion from character string to numerical value-What is the parseInt method of the Integer class? ~
When the character string passed to C ++ by JNA is garbled
How to check for the contents of a java fixed-length string
How to download and run a Jar package directly from the Maven repository with just the command line
[JSR-310 Date and Time API] Precautions for format definition when converting from Japanese calendar character string to date type
[Ruby] I want to make an array from a character string with the split method. And vice versa.
A program that calculates factorials from 2 to 100
I tried to make a web application that searches tweets with vue-word cloud and examines the tendency of what is written in the associated profile
[Java] Difference between equals and == in a character string that is a reference type
When I call the file with Class # getResource from the jar file, it becomes Not Found and it is a crappy memorandum
[Java] Cut out a part of the character string with Matcher and regular expression
A program that outputs a number greater than or equal to the input integer and a number less than the input integer from an array with 50 elements.