Simply String Operation

Results 1 to 2 of 2

Thread: Simply String Operation

  1. #1
    Join Date
    Dec 1969

    Default Simply String Operation

    Hello<BR>I am trying to figure out how to limit the number of characters displayed per line for article titles. I cant find anything in the FAQ section that tells me how to do this.<BR>I know how to find the length of my string<BR>Len(rs("title")<BR>this gives me the number of characters. But how do I insert a "<BR> after a particular character number. Additionally I dont want to cut a word in two. <BR><BR>Thanks In Advance

  2. #2
    Join Date
    Dec 1969

    Default RE: Simply String Operation

    The character limiting is the easy part...<BR><BR>You could do something as simple as...<BR><BR>Left(rs("title"), 10)<BR><BR>Where "10" is the number of characters being displayed...<BR><BR>The second part of your question is more difficult because it would get into string parsing...<BR><BR>For example if you had a title of:<BR><BR>"String Parsing Made Easy"<BR><BR>You would have to write some logic that would look at the character after the last charcter you&#039;ve trimmed and see if a space exists; if one is there then you&#039;ve have a complete word...<BR><BR>If a space is not existing next to the last character trimmed then you would need to dynamically increase the length trimmed until you find that space...<BR><BR>Does this make sense...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts