Originally posted by Michael Zalewski:
Keep the user's input in a textarea.
But when you want to display it read-only, use something like
<textarea wrap="virtual" cols="30" rows="10" style="border:none" readonly>
Netscape 4 ignores the readonly attribute. But if you don't include name=, the fact that the user can type into the textarea doesn't have any effect.
Originally posted by dimps:
how can i use a string tokenizer in a loop.I need to read each line of a file and split it on a delimiter.
My txt file is in the format
A|B|C|D
i have used the following:
try
{
FileReader fr=new FileReader("myfile.txt");
BufferedReader br=new BufferedReader(fr);
while((line=br.readLine())!=null)
{
StringTokenizer st=new StringTokenizer(line,"|");
while (st.hasMoreTokens())
{
a=st.nextToken();
b=st.nextToken();
c=st.nextToken();
d=st.nextToken();
e=st.nextToken();
}
}
}catch(Exception ex){}
What happens is it reads one line then gives nosuchelementfound exception .can u suggest a way of gettin through this.Maybe i need to undefine st object at the end of the loop.If it is tht how do i undefine the object.
Originally posted by bob leduc:
I want to wrap at 15 characters without chumping the words.
Eg: hello, could anyone help? It would be really appreciated.
result: >hello, could_
>anyone help?__
>It would be_
>really_
>appreciated.
this (_) signifies an empty space
It would be greatly appreciated if you can show me an example. Thanks again!