Capital Letters

Discussion in 'ASP General' started by Miguel Orrego, Aug 19, 2003.

  1. I have a form which people use to register in a database. The form passes
    the input data to an asp page that then updates the database.

    The thing is, people often don't bother starting their firstname & surname
    with a capital letter on the form. When this data is dispalyed on other
    pages it would look so much better if they did.

    Does anybody know a way of manipulating the input so that I can substitute
    the first letter of an input string for a capital letter before I update the
    database?

    Some code would be great.

    Cheers.
    Miguel Orrego, Aug 19, 2003
    #1
    1. Advertising

  2. Miguel Orrego

    Mike Guest

    "Miguel Orrego" <-nospam> wrote in message
    news:3f4225da$0$18497$...
    > I have a form which people use to register in a database. The form passes
    > the input data to an asp page that then updates the database.
    >
    > The thing is, people often don't bother starting their firstname & surname
    > with a capital letter on the form. When this data is dispalyed on other
    > pages it would look so much better if they did.
    >
    > Does anybody know a way of manipulating the input so that I can substitute
    > the first letter of an input string for a capital letter before I update

    the
    > database?
    >
    > Some code would be great.


    fname = ucase(left(firstname, 1)) & right(firstname, len(firstname)-1)

    Seems kinda sloppy, but it should work. Any quicker methods?

    --
    Mike
    Mike, Aug 19, 2003
    #2
    1. Advertising

  3. Miguel Orrego

    Randy Rahbar Guest

    > Does anybody know a way of manipulating the input so that I can substitute
    > the first letter of an input string for a capital letter before I update

    the
    > database?


    firstname = capit(firstname)

    function capit(str)
    str = ucase(left(str,1)) & mid(str,2)
    end function
    Randy Rahbar, Aug 19, 2003
    #3
  4. Miguel Orrego

    Randy Rahbar Guest

    > function capit(str)
    > str = ucase(left(str,1)) & mid(str,2)
    > end function


    Oops... this should read..

    function capit(str)
    capit= ucase(left(str,1)) & mid(str,2)
    end function
    Randy Rahbar, Aug 19, 2003
    #4
  5. Miguel Orrego

    Evertjan. Guest

    Randy Rahbar wrote on 19 aug 2003 in
    microsoft.public.inetserver.asp.general:

    >> function capit(str)
    >> str = ucase(left(str,1)) & mid(str,2)
    >> end function

    >
    > Oops... this should read..
    >
    > function capit(str)
    > capit= ucase(left(str,1)) & mid(str,2)
    > end function


    capit= ucase(left(str,1)) & lcase(mid(str,2))

    Some people are called O'Brian:

    =====================

    Function ProperCase(a)
    b=""
    notyet=true
    For i=1 to Len(a)
    m=mid(a,i,1)
    If notyet Then
    b=b+Ucase(m)
    Else
    b=b+Lcase(m)
    End If
    If Ucase(m)=Lcase(m) Then
    notyet= true
    Else
    notyet=false
    End If
    Next
    ProperCase=b
    End Function

    =====================

    For a Dutch site,
    the lowering of "van", de", "der" should be considered.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Aug 19, 2003
    #5
  6. Miguel Orrego

    Don Verhagen Guest

    In news:3f4225da$0$18497$,
    Miguel Orrego <-nospam> typed:
    : I have a form which people use to register in a database. The form
    : passes the input data to an asp page that then updates the database.
    :
    : The thing is, people often don't bother starting their firstname &
    : surname with a capital letter on the form. When this data is
    : dispalyed on other pages it would look so much better if they did.

    Not to be too coy, but it would look better to *you*. Why decide? Let the
    user type the name in how they want to it appear (with obvious limitations
    on "special/extended" characters). Give the user the ability to change the
    way their name appears and leave it at that.

    As mentioned in another post a dutch name with "de" should be left in lower
    case, you would suggest changing it to:

    Hans de Husen to Hans De Husen, which to the user, would not "look much
    better" if you did.

    My 2 cents, don't sweat the small stuff.

    Don Verhagen
    Tandem Staffing Solutions, Inc.






    : Does anybody know a way of manipulating the input so that I can
    : substitute the first letter of an input string for a capital letter
    : before I update the database?
    :
    : Some code would be great.
    :
    : Cheers.
    Don Verhagen, Aug 19, 2003
    #6
  7. "Evertjan." wrote:
    >
    > Yes, empty strings exist.
    >
    > No, you cannot type them in.


    I am, for better or worse, stuck with a mind that accepts nothing at face
    value, so I gave this some thought, and concur.

    I note, however, that (a) you can un-type a non-empty string (thus making it
    empty), and (b) you can type a NULL value in Enterprise Manager (CTRL+0).


    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, Aug 20, 2003
    #7
    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. Ebi
    Replies:
    2
    Views:
    12,598
    puzzlecracker
    Feb 5, 2005
  2. Eric Wertman
    Replies:
    2
    Views:
    321
  3. Ralph Shnelvar

    Splitting on capital letters

    Ralph Shnelvar, Dec 8, 2010, in forum: Ruby
    Replies:
    12
    Views:
    335
    Robert Klemme
    Dec 9, 2010
  4. Keith Bowes

    Avoid All Capital Letters in Guestbook

    Keith Bowes, Jan 6, 2004, in forum: Javascript
    Replies:
    4
    Views:
    782
    Thomas 'PointedEars' Lahn
    Jan 15, 2004
  5. Venugopal
    Replies:
    11
    Views:
    1,498
    Tassilo v. Parseval
    Nov 5, 2003
Loading...

Share This Page