473,394 Members | 1,735 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,394 software developers and data experts.

problem with tags

hi friends
i've built a page that should show first 150 chars of every of my
topics but when i wanted to do this work with SubString() it included
the tags of my field of my db and very bad viewing happend
i want to retrieve rendered text without any tag ...
please help me ...
Jan 15 '08 #1
7 1098
Sounds like there's a problem with your code, but you didn't include your
code, or any details about what you are doing beyond using SubString() so I
really don't see how anyone can help you.

Perhaps you should show, or at least describe, just what you are doing.

Beyond that, you can set a break point at look at the string being passed to
Substring and your arguments and you should be able to see why it returns
what it does.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

<mi********@gmail.comwrote in message
news:d6**********************************@x69g2000 hsx.googlegroups.com...
hi friends
i've built a page that should show first 150 chars of every of my
topics but when i wanted to do this work with SubString() it included
the tags of my field of my db and very bad viewing happend
i want to retrieve rendered text without any tag ...
please help me ...
Jan 15 '08 #2
Goo evening,

I think he's trying to trim text containing HTML content (which isn't
trivial).
--
Milosz
"Jonathan Wood" wrote:
Sounds like there's a problem with your code, but you didn't include your
code, or any details about what you are doing beyond using SubString() so I
really don't see how anyone can help you.

Perhaps you should show, or at least describe, just what you are doing.

Beyond that, you can set a break point at look at the string being passed to
Substring and your arguments and you should be able to see why it returns
what it does.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

<mi********@gmail.comwrote in message
news:d6**********************************@x69g2000 hsx.googlegroups.com...
hi friends
i've built a page that should show first 150 chars of every of my
topics but when i wanted to do this work with SubString() it included
the tags of my field of my db and very bad viewing happend
i want to retrieve rendered text without any tag ...
please help me ...

Jan 15 '08 #3
Perhaps, that's something I've done. It's just hard to help someone when
they don't show what they did.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Milosz Skalecki [MCAD]" <mi*****@DONTLIKESPAMwp.plwrote in message
news:59**********************************@microsof t.com...
Goo evening,

I think he's trying to trim text containing HTML content (which isn't
trivial).
--
Milosz
"Jonathan Wood" wrote:
>Sounds like there's a problem with your code, but you didn't include your
code, or any details about what you are doing beyond using SubString() so
I
really don't see how anyone can help you.

Perhaps you should show, or at least describe, just what you are doing.

Beyond that, you can set a break point at look at the string being passed
to
Substring and your arguments and you should be able to see why it returns
what it does.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

<mi********@gmail.comwrote in message
news:d6**********************************@x69g200 0hsx.googlegroups.com...
hi friends
i've built a page that should show first 150 chars of every of my
topics but when i wanted to do this work with SubString() it included
the tags of my field of my db and very bad viewing happend
i want to retrieve rendered text without any tag ...
please help me ...

Jan 15 '08 #4
:)
sorry my english language is not good
for eg :
in my record of field is this text
<bhello world </b>
and i want to show only 5 first chars
i don't want the "<b>" tag be
i need my basic text without any style
that is the "hello"
thanks for your attention

Jan 16 '08 #5
On 16 Січ, 07:15, "miladha...@gmail.com" <miladha...@gmail.comwrote:
in my record of field is this text
<bhello world </b>
and i want to show only 5 first chars
i don't want the "<b>" tag be
i need my basic text without any style
that is the "hello"
Remove tag by means of a regular expression.

Regex re = new Regex("<[^>]*>", RegexOptions.Multiline);
string pureText = re.Replace(originalString, "");

And then pureText.SubString(..

Regards
Mykola
http://marss.co.ua - Casual ideas for web development

Jan 16 '08 #6
oh thanks
i do this and work well
thanks my friend
Jan 16 '08 #7
Goo evening guys,

Having said it's not a trivial task i meant it's not trivial when trimming
text but persisting HTML. Mars' resolution will work only in most all of the
cases, but not if you trim the text at a html encoded character. This case is
easy to handle by making sure by checking if the ampersand is not included in
last 6 characters. Similar issue to this:
http://www.dcomments.net/ASP_.NET/message1516138.html

Regards
--
Milosz
"marss" wrote:
On 16 Січ, 07:15, "miladha...@gmail.com" <miladha...@gmail.comwrote:
in my record of field is this text
<bhello world </b>
and i want to show only 5 first chars
i don't want the "<b>" tag be
i need my basic text without any style
that is the "hello"

Remove tag by means of a regular expression.

Regex re = new Regex("<[^>]*>", RegexOptions.Multiline);
string pureText = re.Replace(originalString, "");

And then pureText.SubString(..

Regards
Mykola
http://marss.co.ua - Casual ideas for web development

Jan 16 '08 #8

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

Similar topics

18
by: Greg G | last post by:
http://mysite.verizon.net/gdguarino/indexnew.htm It's not a high priority site, just some of my photos throughout the years. The address above is an experiment for a new home page. My intended...
6
by: ima | last post by:
http://www.kencoffman.com/templates.htm I've been experimenting with float:left and I've been able to clear those floats as far as Opera 8.02 and Firefox 1.0.6 but IE6 is a problem. I've...
4
by: dwergkees | last post by:
Hi, Got a litte problem here. I'm trying to create a XSLT file that will do a transformation from WordML format (MS Word XML format, see...
12
by: Justin | last post by:
I can attach my code if anyone wants to see it however I'll try to ask my question with some mark up code first. I'm having a problem terminating my process while using DoEvents. For example: ...
3
by: =?Utf-8?B?c2JwYXJzb25z?= | last post by:
I have a scenario where a string is sent in chunks to my app. I need to be able to identify certain tags in this partial string as it arrives. eg <DALFile>xxxxxxxxx</DALFile> I need to be able...
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
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...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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...

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.