String manipulation

Discussion in 'ASP .Net' started by Chris, May 24, 2004.

  1. Chris

    Chris Guest

    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
    Chris, May 24, 2004
    #1
    1. Advertising

  2. Chris

    Pete Wright Guest

    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,


    --
    --------------------------------------------------------
    Peter Wright (www.petewright.org)
    Author of ADO.NET Novice To Pro
    From Apress. www.apress.com (and 10
    other doorstops from Wrox)


    "Chris" <> wrote in message
    news:...
    > 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
    >
    >
    Pete Wright, May 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jared in ecs

    Perl string manipulation

    jared in ecs, Oct 22, 2003, in forum: Perl
    Replies:
    2
    Views:
    806
    Roy Johnson
    Oct 22, 2003
  2. Garfield

    String Array Manipulation Problem

    Garfield, Aug 27, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    2,811
    Michael Lang
    Aug 27, 2003
  3. Aaron

    String Manipulation

    Aaron, Dec 31, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    4,621
    Dave Davidson
    Dec 31, 2003
  4. Aaron

    Advanced String Manipulation (C#)

    Aaron, Jan 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    816
  5. mark

    string manipulation

    mark, Apr 27, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    347
    =?Utf-8?B?QnJhZCBRdWlubg==?=
    Apr 27, 2005
Loading...

Share This Page