String manipulation

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hey

I want to only show the first 7 words of a string in an <asp:repeater>.

<asp:repeater>
<itemtemplate>
<%# DataBind.Eval(Container.DataItem, "bodytext");
</itemtemplate>
</asp:repeater>

Any tips as to the best way to do this?
Cheers
Chris
 
Write a function to count spaces in a passed in string, and return the part
of the string before 7 spaces are counted. Then in your page simply pass the
bound item to the function.

Hope that helps,


--
 
Back
Top