R
Rahul Sharma
I get problem using FileWriter when I insert "/n" in it .It shows some
ugly square instead of going to the new line
I tried following code
***********************************************************************
import java.io.*;
class Writer
{
public static void main(String args[])
{
String str ="Rahul is writing this piece\n"
+"I know that black square will come in place of newline
character\n"
+"I there anybody who can help me\n";
char [] ch = new char[str.length()];
str.getChars(0,str.length(),ch,0);
try
{
FileWriter fw =new FileWriter("testfile.txt");
fw.write(ch);
fw.close();
}
catch(IOException ioe){}
}
}
**********************************************************************
Please help in case you have a solution to this problem
Thanking in anticipation
Rahul Sharma
(e-mail address removed)
ugly square instead of going to the new line
I tried following code
***********************************************************************
import java.io.*;
class Writer
{
public static void main(String args[])
{
String str ="Rahul is writing this piece\n"
+"I know that black square will come in place of newline
character\n"
+"I there anybody who can help me\n";
char [] ch = new char[str.length()];
str.getChars(0,str.length(),ch,0);
try
{
FileWriter fw =new FileWriter("testfile.txt");
fw.write(ch);
fw.close();
}
catch(IOException ioe){}
}
}
**********************************************************************
Please help in case you have a solution to this problem
Thanking in anticipation
Rahul Sharma
(e-mail address removed)