473,511 Members | 15,046 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with string

I am using the following code to populate a texst box:

private string convertstring(string getLD)

{
Byte[] myBytes13 = {13};
string myStr13 = System.Text.Encoding.ASCII.GetString(myBytes13);

Byte[] myBytes10 = {10};
string myStr10 = System.Text.Encoding.ASCII.GetString(myBytes10);

Byte[] myBytes32 = {32};
string myStr32 = System.Text.Encoding.ASCII.GetString(myBytes32);

Byte[] myBytes9 = {9};
string myStr9 = System.Text.Encoding.ASCII.GetString(myBytes9);

string myLD = getLD.ToString().Replace(myStr13 + myStr10 + myStr13 + myStr10,"<p>");
myLD = myLD.Replace(myStr13 + myStr10,"<br>");
myLD = myLD.Replace(myStr32 + myStr32 + myStr32," ");
myLD = myLD.Replace(myStr9," ");

return myLD;
}

public void FillLdLabel()
{
DataView dv = CreateLdDataSource();
ldText.Text = convertstring(dv[0].Row["Ldtext"].ToString());
}

This returns the following:

PER THE ATTACHED 332 FORM:<br>- REPAIR GALVANIC ANODE CATHODIC PROTECTION SYSTEM.<p>THE CURRENT SYSTEM IS OUT OF OPERATING BELOW CAPACITY. LOSS OF CATHODIC PROTECTION MAY CAUSE EARLY FAILURE OF THE FACILITY PROTECTED, DUE TO CORROSION.<p>LOCATION: 72802<p>2/13/04 FWD TO 212013 FOR P3 PROGRAM. (CJB).<br>02/18/04 TRAVELER FWD TO P3;ZS<br>03/04/04 PER ART HERRINGTON, 332 PROCESS COMPLETE, AWAITING 1391 INITIATED/COMPLETED;ZS<br>04/16/04 COPY OF 332 WITH ORIGINAL SIGNATURES FWD TO CHRIS BARBE TO MERGE WITH TRAVELER;CAM

I need to replace every <br> or <p> with two carriage returns. How do I accomplish this?

Thanks,

Dave
Nov 16 '05 #1
2 1354


string myLD = getLD.ToString().Replace(myStr13 + myStr10 + myStr13 + myStr10,"<p>"); myLD = myLD.Replace(myStr13 + myStr10,"<br>");
myLD = myLD.Replace(myStr32 + myStr32 + myStr32," ");
myLD = myLD.Replace(myStr9," ");
myLD = myLD.Replace("<br>"," \r\r")..Replace("<p>"," \r\r").;
return myLD;
}

I hope this helps

ToOl

Nov 16 '05 #2

AutoCorrect
too many dots
Użytkownik "Tool" <so***@no.spam> napisał w wiadomo¶ci
news:ca**********@nemesis.news.tpi.pl...


string myLD = getLD.ToString().Replace(myStr13 + myStr10 + myStr13 + myStr10,"<p>");
myLD = myLD.Replace(myStr13 + myStr10,"<br>");
myLD = myLD.Replace(myStr32 + myStr32 + myStr32," ");
myLD = myLD.Replace(myStr9," ");


myLD = myLD.Replace("<br>"," \r\r").Replace("<p>"," \r\r");

return myLD;
}

I hope this helps

ToOl

Nov 16 '05 #3

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

Similar topics

18
1821
by: muser | last post by:
is string converted to its integer equivalent by minusing it by 48? the function is suppose to check the fifth digit of struct member using the formula contained within the function. The function...
7
10613
by: Forecast | last post by:
I run the following code in UNIX compiled by g++ 3.3.2 successfully. : // proj2.cc: returns a dynamic vector and prints out at main~~ : // : #include <iostream> : #include <vector> : : using...
6
6493
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
18
6138
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
12
9616
by: Jeff S | last post by:
In a VB.NET code behind module, I build a string for a link that points to a JavaScript function. The two lines of code below show what is relevant. PopupLink = "javascript:PopUpWindow(" &...
7
5206
by: Ankit Aneja | last post by:
I put the code for url rewrite in my Application_BeginRequest on global.ascx some .aspx pages are in root ,some in folder named admin and some in folder named user aspx pages which are in user...
4
7995
by: David Scemama | last post by:
Hi, I'm trying to read a database file written from a turbo Pascal program. I've set a structure to map the records in the file, but I have problem reading the file when I use VBFixedArray in...
16
4870
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
5
19560
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was...
8
1267
by: Rinaldo | last post by:
Hi, When I start my program in the debugger, there is no problem, but when not I get an exception. It appears in: private void Upload(string filename, string FTnaam) { MessageBox.Show("in...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.