Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Text Manipulation

Reply
Thread Tools

Text Manipulation

 
 
Mohamed Ahmed Meligy
Guest
Posts: n/a
 
      06-17-2004
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 ?


 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      06-17-2004

"Mohamed Ahmed Meligy" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with logic for simple text-manipulation function Rex Java 2 11-21-2006 03:36 AM
NewB question on text manipulation ProvoWallis Python 4 05-03-2006 07:25 PM
text manipulation Johhny Python 5 12-16-2005 01:36 PM
text manipulation jack-e ASP .Net 3 08-09-2005 03:29 PM
RE: Perl vs. Python for text manipulation Tim Peters Python 0 01-24-2004 09:38 PM



Advertisments