473,385 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Replace line feed in RTF

I am replacing tags with db info. My problem is I some of the addresses do
NOT have an address1. end up with a blank line. I want to get rid of that line

I am using the following code to replace

tempbbb.Rtf = tempbbb.Rtf.Replace("<address1>", newArray[i].ToString());
<firstName<lastName>
<address>
<addresss1>
<city>, <state<zip>

Dear Dave,

This is the letter.

Notice I have line breaks in the text.

If there is no address1 I end up with...

Dave Smith
117 street

mytown, OH 11111

I want

Dave Smith
117 street
mytown, OH 11111

Dear Dave,

This is the letter.

Notice I have line breaks in the text.

Feb 21 '07 #1
1 2762
Maybe something like this will work:

if(newArray[i].ToString().Length == 0)
tempbbb.Rtf = tempbbb.Rtf.Replace(Environment.NewLine +
"<address1>", "");
else
tempbbb.Rtf = tempbbb.Rtf.Replace("<address1>",
newArray[i].ToString());

You may have to examine exactly what your file is using for newline,
and change the Environment.NewLine to be what you find.

=====================
Clay Burch
Syncfusion, Inc.

Feb 21 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Neil S. | last post by:
I am writing an ISAPI filter which is using CAPICOM to encrypt and decrypt cookie information. I've found that the encryption string being returned by CAPICOM a has carriage control and line feed....
4
by: Robert | last post by:
Is there some way to suppress the automatic line feed in the detail section of a report in Access? I would like the detail to print out to the right of the existing one. The next line would be...
3
by: David N. | last post by:
Hi All, I spent too much time on trying to get the CrLf into a string, which contains embedded SQL statements that can be executed by the SQLClient.SqlCommand. Note that these SQL statements...
1
by: Raed Sawalha | last post by:
Is it possible to make the following div to generate automatic line feed when user start writing and reaches the DIV bounderies like in textarea, the case I have when type a continous chars without...
1
by: Frank Esser | last post by:
Hello, I read data from a DB field where a line feed ("\n") is in. I put this data as text to a label web control. In the HTML page the line feeds are shown as real line feeds in the HTML...
2
by: Michael Peters | last post by:
is there a way to replace a certain sequence of characters by line feed (vbCrLf ), for all text columns in a table, using Search+Replace? -Michael
1
by: laredotornado | last post by:
Hello, What am I doing wrong in my regular expression? I'm trying to replace line break characters by responseText = responseText.replace(/(\r|\n)/, ""); However my response still...
1
by: Nalaka | last post by:
Hi, We are sending SMS messages using our ASDP.net site (C# code).... How do I add a "Line Feed" character to the string that we are sending? Any help is deeply appreciated Thanks Nalaka
1
by: rengaraj | last post by:
Dear Experts, I am new to XML I want to create an Interview Questions Bank (Intra Net) for our institution. I preferred to store the Question & Answer in xml sheet. But if i vew the xml in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.