Can I Make It a Capital Letter?

Results 1 to 6 of 6

Thread: Can I Make It a Capital Letter?

  1. #1
    Terrence McNally Guest

    Default Can I Make It a Capital Letter?

    I have a page that lists hundreds of names like "Doe, Jon" from a database. The DB fields are "firstname" and "lastname." Unfortunately, many people are sloppy and do not capitalize the first letters of the names. <BR><BR>Is there an ASP routine I can run to check if the first letter is capitalized and, if not, capitalize in when it outputs the database the Web page? Thanks.<BR><BR>Terrence

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default Code it

    SomeString = UCase(Left(SomeString, 1)) & LCase(Right(SomeString, Len(SomeString) - 1))<BR><BR><BR>where SomeString is the string you want to format.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Can I Make It a Capital Letter?

    First_Name = Left(Ucase(rs("firstname")), 1) & Lcase(Mid(rs("firstname"), 2))<BR><BR>Last_Name = Left(Ucase(rs("lastname")), 1) & Lcase(Mid(rs("lastname"), 2))<BR><BR>Full_Name = Last_Name & ", " & First_Name<BR><BR>That should work barring any silly mistakes.<BR><BR>

  4. #4
    Join Date
    Dec 1969

    Default What if ...

    Their surname does NOT begin with a capital letter ?<BR><BR>Many surnames begin with "de" which is often written with a lower case d. In my database there are well over 1000 people with names that genuinly begin with a lowercase letter

  5. #5
    Akhilesh` Guest

    Default Isnt that

    middle name??<BR><BR>

  6. #6
    Join Date
    Dec 1969

    Default Unfortunately not ...

    No, honestly it is the surname here are some examples<BR><BR>de la Cruz<BR>de Meyer<BR>de Monts de Savant<BR>de Szilberezki<BR><BR>Oh and of course<BR>zur Jacobsm├╝hlen<BR><BR>

Posting Permissions

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