@OP: This will definitely require String manipulation. To see what you can do with a Java String object, google java 11 string api
. (The "11" can be whatever version of Java you have.) You could also use RegExes, but hopefully not, since this is not a beginning concept.
So to clarify, the text file might look like this:
It is *very* important that our copy of %Moby Dick% be preserved.
and it would create this output:
I would start writing out all of the steps you would take to do this in plain English. Like...
If the text starts with "title:", remove "title:" and surround the remaining text with <title> opening and closing tagsIf a line of text contains an asterisk, remove it, search for the next asterisk, and place the text between them inside <b> opening and closing tags
It's also going to be important to know if you can assume that the text is well-formed. So for instance, if you encounter an asterisk, will there be another to find? Could it be on the next or proceeding lines? Things like that.
By the way, this is not
a simple assignment.