Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Maximum ASP
  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Chat About It!  RegExp to retrieve a summary of 125 characters from a Html text chunk?
Previous Previous
 
Next Next
New Post 6/29/2008 12:41 PM
Resolved
User is offline Johan Johansson
178 posts
www.itansvar.se
9th Ranked


RegExp to retrieve a summary of 125 characters from a Html text chunk? 

Hi all DNN Pros

I am looking for a way to retrieve through regexp a text chunk that could be representing a summary of a bigger Html chunk of text .... I want to exclude the Html formatting and only get the textinfo itself ... does this precedure exist inside any of the DotNetNuke source code?

/Johan

www.evolvia.se  www.nätdejting.nu   www.chefsrekrytering.biz


Rekryteringsföretag
 
New Post 7/1/2008 8:42 AM
User is offline Johan Johansson
178 posts
www.itansvar.se
9th Ranked


Re: RegExp to retrieve a summary of 125 characters from a Html text chunk? 
Modified By Johan Johansson  on 7/1/2008 10:43:43 AM)

Hi all DNN pros

I have found what I was looking for:

            Dim HtmlText2 As String = ""
            Dim re As New Regex("<\S[^>]*>")
            HtmlText2 = re.Replace(HtmlText, "")
            Dim HtmlTextSummary As String = MakeSummary(HtmlText2)

 

        Private Function MakeSummary(ByVal instring As String) As String
            Dim outstring As String = ""
            Dim Length As Integer = instring.Length
            If Length > 155 Then
                Length = 155
            End If
            outstring = instring.Substring(0, Length) + " ..."
            Return outstring
        End Function

does get my text without any Html and then I just chop of a 155 character bit in the beginning.

/Johan   www.fotbolls-vm-2010.nu


Rekryteringsföretag
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Chat About It!  RegExp to retrieve a summary of 125 characters from a Html text chunk?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Alki Homes - Seattle, WA
Exemplary service for your Seattle Real Estate needs. It's what you deserve from your Realtor®!
www.alkihomes.com
PointClick DotNetNuke Solutions
PointClick Technologies provides high-end DNN Hosting for businesses.
PointClick.Net Hosted Solutions
Active Modules, Inc.
Creators of Active Forums, the best forum module for DotNetNuke
www.activemodules.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP