Forums Register Login

Doing funny things with code, trying to copy code in TextArea leaving out comments

+Pie Number of slices to send: Send
Hi!
Exercise is using a given class TextFlaeche:
(Sorry that there are lots of comments in there but we need them later on anyway...)



Write a program using RandomAccessFile to copy the code of TextFlaeche into a String[] "content"...
Make a TextFlaeche-Object, create a TextArea and copy the code upside down into the text area...
(With numbered lines and append())



To have more fun: LEAVE OUT THE COMMENTS!!!
It works somewhat like 7/10.

Problem is that it doesn't leave out the lines that begin with "/*" and I don't get why!
I used boolean kommentarVanish to leave out lines...
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 749 times.
Similar Threads
Error messages using ODBC
Action Listener
I need help with seeking to abitiary positions within a text file.
set Focus in Border Layout
File Reader
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:25:37.