2013-02-28

How to write the end-of-file character in a Java String?

Use the \u001a unicode character.

There is a character called EOF. It's also called control-Z.
If you want to include it in a string, you have to type it as "\u001a" as in:

String iHaveAnEof = "file ends here\u001a";

Credits:

Ed Staub

http://stackoverflow.com/a/7591594/129497

No comments: