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.
Set the date and time from the character string with POI
[Convenient to remember !!!] How to convert from LocalDate type to character string and from character string to LocalDate type
Precautions when converting from decimal number to binary number
Change date and time to Japanese notation in Rails
[Rails] Precautions when comparing date and time with DateTime
A memorandum when I investigated how to convert from Epoch Time to Date type in Scala
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.
[Java] How to convert a character string from String type to byte type
Change only one character from the String type string to uppercase
Standard API for string format
[Caution !!] Precautions when converting Rails devise and view files to haml
[Java] How to convert from String to Path type and get the path
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
[Ruby] I want to make a program that displays today's day of the week!
Search for character string B from character string A (duplicate count)
[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
A program that determines whether the entered integer is close to an integer
[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
[Ruby] A program that uses search and each_with_index
[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.