Assuming szStr contains '\n', try: if (szStr.indexOf('\n') >= 0) { szStr = szStr.substring(0, szStr.indexOf('\n') + 1); }
---- Original Message ---- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED], Subject: Re: FileWriter question Date: Tue, 12 Feb 2002 15:51:35 -0500 >perhaps string.trim() will serve this purpose? > >-----Original Message----- >From: sufi malak [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, February 12, 2002 12:25 PM >To: [EMAIL PROTECTED] >Subject: Re: FileWriter question > > >no, it does not work. >another question please how to get rid of an \n from a string before >using >it in Writer.write(string); > >===================================================================== >====== >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff >JSP-INTEREST". >For digest: mailto [EMAIL PROTECTED] with body: "set >JSP-INTEREST DIGEST". >Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > http://www.jspinsider.com > =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com