Results 1 to 2 of 2

Thread: Trim Inside

  1. #1
    Join Date
    Feb 2007
    Posts
    72

    Default Trim Inside

    Hello

    I am trying to find away to trim white space from the inside of a string.
    I am using the following derive_fields (with many thanks to Russell) to trim off white space in front and after the fieldnameX values and any leading zeros.
    Code:
    <input type="hidden" name="derive_fields" value="
         fieldname1=%rtrim(fieldname1)%,fieldname1=%ltrim0(fieldname1)%,
         fieldname2=%rtrim(fieldname2)%,fieldname2=%ltrim0(fieldname2)%,
         fieldname3=%rtrim(fieldname3)%,fieldname3=%ltrim0(fieldname3)%,
                        " />
    If someone was to enter 8 8, I need to be able to trim the inside white space to result in 88.

    Ideas?

    Thank you
    Nelson

  2. #2
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Trim Inside

    Hi,

    There is no function to trim inside a field.

    If someone enters "8 8", you're better to generate an error using a conditions test than to assume they mean "88".

    I can't think of any computer system that would make that assumption - it always has to be a data entry error.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Email Link inside HTML Email?
    By dalbeck in forum Community Support
    Replies: 8
    Last Post: 27-Apr-2010, 06:39 PM
  2. Recipient list inside formmail.php
    By starsailor in forum Community Support
    Replies: 3
    Last Post: 06-Mar-2006, 09:12 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
  •