Thanks again for your intelligent advice and support. Ron [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Photoshare [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> Output text field up until first period? - Coldfusion - Advanced Techniques

Output text field up until first period? - Coldfusion - Advanced Techniques

Hi, I wonder if anyone knows how I could output just the first sentence of a field. I have a field that is a paragraph (varies) in length. On output I have the need to grab just the first sentence up until the period. I've been using the "left()" function, however there's no way (that I know of) to tell it to break after a period. Is there a REGEX expression I could use or another way of doing this? Thank you in advance. Ron...

  1. #1

    Default Output text field up until first period?

    Hi,

    I wonder if anyone knows how I could output just the first sentence of a
    field. I have a field that is a paragraph (varies) in length. On output I
    have the need to grab just the first sentence up until the period. I've been
    using the "left()" function, however there's no way (that I know of) to tell it
    to break after a period. Is there a REGEX expression I could use or another
    way of doing this?

    Thank you in advance.


    Ron

    Photoshare Guest

  2. #2

    Default Re: Output text field up until first period?

    You are on the right track, I would first do a findNoCase() for a ".". Once
    you have the period, you can do a left() based on the location of the "." So,
    do a left ending at 1+the location of the period. That way, you also get the
    period. Actually, you may not need the 1+, but I didn't test it, so you'll
    need to figure out which one is the best.

    Mark

    quig06107 Guest

  3. #3

    Default Re: Output text field up until first period?

    Thank you. It was so simple yet it never came to mind to do what you said. I
    actually decided to look for a blank space instead of a period. But works
    either way. Here is what I wrote.

    <!--- Don't find a space until after 120 characters ------>
    <cfset sentence1 = "FindOneOf(" ", #field#, 120)">

    <!--- Grab x number of characters from the left of the #field# --------->
    <cfset sentence2 = "left(#field#,sentence1)">


    Thanks again for your intelligent advice and support.


    Ron

    Photoshare Guest

Similar Threads

  1. Replies: 5
    Last Post: June 27th, 05:52 PM
  2. Defined text field in form -> subject field in e-mail
    By olaka in forum Dreamweaver AppDev
    Replies: 0
    Last Post: March 14th, 02:20 PM
  3. Replies: 2
    Last Post: February 22nd, 04:59 PM
  4. how to extract data filtering by a DateTime field (depending sample period time) ?
    By herve maillard in forum Microsoft SQL / MS SQL Server
    Replies: 3
    Last Post: July 6th, 05:41 AM

Bookmarks

Posting Permissions

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