473,480 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Text Manipulation

Can't anyone help me with this ?
I need it very soon to finish my project before sataerday.
Thank you in advance.
I want to develop a content management component that suits a blog or a
portal.
In it I develop an article authoring/browsing tool withwhich I do have a
problem.
When posting an Article, I want to replace each word like microsoft with
<a href=http://www.microsoft.com">Microsoft</a> where
http://www.microsoft.com is stored in the database. This is not a very big
problem I think especially using "foreach" in C#.
My real problem is tat I may provide the same word "Microsoft" as a part of
a URL liike
<a
href=http://www.microsoft.com/technet/community/scriptcenter/default.mspx">
Check out the new scripts in the TechNet Script Center </a>
or even an <asp:Hyperlink> ... In such cases, replacing the word "Microsoft"
is never wanted as it'll make a big problem to me.
How should I do that ?
Nov 18 '05 #1
1 882

"Mohamed Ahmed Meligy" <xm*******@hotmail.com> wrote in message news:ev**************@TK2MSFTNGP09.phx.gbl...
Can't anyone help me with this ?
I need it very soon to finish my project before sataerday.
Thank you in advance.
I want to develop a content management component that suits a blog or a
portal.
In it I develop an article authoring/browsing tool withwhich I do have a
problem.
When posting an Article, I want to replace each word like microsoft with
<a href=http://www.microsoft.com">Microsoft</a> where
http://www.microsoft.com is stored in the database. This is not a very big
problem I think especially using "foreach" in C#.
My real problem is tat I may provide the same word "Microsoft" as a part of
a URL liike
<a
href=http://www.microsoft.com/technet/community/scriptcenter/default.mspx">
Check out the new scripts in the TechNet Script Center </a>
or even an <asp:Hyperlink> ... In such cases, replacing the word "Microsoft"
is never wanted as it'll make a big problem to me.
How should I do that ?


Assuming that the text is html, so that a literal "<" is encoded (as &lt;),
you can walk through the string, noting start (<) and finish (>) of tags.
Replace only in texts that are not tags.
The rest is left as an exercise for the reader :-)

Hans Kesting
Nov 18 '05 #2

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

Similar topics

3
4506
by: Anonymous | last post by:
I need to create an application that will do fairly simple text manipulation on 20,000 files in text format (html files). The files exist both on my Windows machine and on a FreeBSD server. I...
10
3663
by: ross | last post by:
I want to do some tricky text file manipulation on many files, but have only a little programming knowledge. What are the ideal languages for the following examples? 1. Starting from a certain...
3
3014
by: Fabian | last post by:
I have created a javascript to manipulate a text strong given to it. It works in all the situations I put it in. Now, I want to create a form based interface. Essentially, the use types in the text...
1
2159
by: Andrew Poulos | last post by:
Say I have a page, which has been created by a third party, and the page may contain some pre-specified text. How can I find and replace that text dynamically? For example, if the page I have...
2
1364
by: UJ | last post by:
I've got a text box that I'm going to be doing some manipulation on (selecting text, moving stuff around, that kind of thing) but I don't want/need the user to see it while it's going on. I'd like...
0
2561
by: L'eau Prosper Research | last post by:
Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases new TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set. L'eau Prosper Market...
0
2335
by: L'eau Prosper Research | last post by:
NEW TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set By L'eau Prosper Research Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases...
1
3498
by: blangela | last post by:
Bjarne Stroustrup has a new text coming out called "Programming: Principles and Practice Using C++" (ISBN: 0321543726), due to be published in December of this year. Some of the features of this...
15
17348
by: pakerly | last post by:
How would i do this, convert a test file to excel? Lets say my text file has fields like this: NUMBER NAME ADDRESS PHONE 11002 Test1 ...
1
1953
by: nick777 | last post by:
Hope the Community can bear with me as I muddle with the vocabulary since I am not really sure if I am going about this the correct way. My question is as follows: If I had some sample data in...
0
6904
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
7076
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...
1
6730
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6873
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
5321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4767
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4471
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
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
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 ...

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.