Does anyone know what's the Java syntax to append
a "EOF" character to the end of a string?
String mystring;
mystring = mystring + ?????;
Thanks
Stephen
Have a look at the source code for String. Strings are actually substrings
of char[] consisting of an offset and length. Several String constants can
share a common base char[].
Unlike C/C++, Java keeps track of how long its strings are rather than
scanning for a terminating null.
For the JAVA GLOSSARY and the CMP Utilities: http://oberon.ark.com/~roedy
--
Roedy Green Roedy rhymes with Cody ro...@bix.com ICQ:5144242
Canadian Mind Products contract programming (250) 285-2954
POB 707 Quathiaski Cove Quadra Island BC Canada V0P 1N0
-30-
What end-of-file character?
Daniel
if you mean chr$(26) you could do it with octal notation:
String s = "abc" + "\032";
if you mean chr$(0), you don't need it for Java since it tracks it own
string lengths. If you want a trailing null for native C, you could use
the same technique:
String s = "abc\000";
Hey. Don't quote me out of context.
I didn't ask that question; your message could imply that I did.
Daniel