How to seperate <Enter> from a String in mySQL DB
I've a form who's data i'm submitting into mySQL Database. i've wnat to display the data from the DB to teh screen but if user had pressed <Enter> after a sequence of characters , which is represented as "\r\n" in db , I've to represent it the similar way on to the Screen .Like:-
This
is
just
Test
has to represented as it is & not as"This is just Test".
How to do it .Plz help.
I am not sure what u r writing .But I think u want to have string like :" I /n"+"am /n"+"not /n"+" clear /n";if not this, do write ur problem,bye,Samir
Samir,
my requirement is ..if user has pressed <Enter> somewhere in filling a form, i need to break the line at that character & display the rest of the String on next line.
I doono how to do that. Like :-
This
is
testing
sud appear like this only ..& not like "This is testing", which is stored in DB as "This\r\nis\r\ntesting"
My problem is to break teh line at every occurance of "\r\n"
Help appreciated .
oh!
That means u have : "this /n is/n test/n" test in ur database and to display it is a problem
ok?
If I am right then u can use substring to get the string from 0 to for first occurance of /n and
then first occurance of /n to second occurance of /n and so on.
if u can do this ,ok. or write me I will give u code, but try urself first,
ok? bye,
Samir
I'm able to get the Identify the <enter> in my String thru code:-
int lAbstract = abstrac.length(); //lenght of abstrac field
out.println("Length of abstract is : "+lAbstract);
boolean rtrue=true;
boolean rfalse=false;
for (int intIndex=0;intIndex<lAbstract;intIndex++)
{
boolean t = abstrac.startsWith("\r\n",intIndex);
if (t==rtrue)
{
out.println("Enter at : "+intIndex);
}
}
But now i'm getting confused how to print the string with correct formatting....>