Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[981] Proper Capitalization

Last post 09-16-2005 7:03 AM by floydfix. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [981] Proper Capitalization

    This thread is for discussions of Proper Capitalization.

    • Post Points: 0
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 02-04-2004 10:40 AM In reply to

    Perfect answer

    This did exactly what I needed it to do. I had a list of company names that were all in caps, so I used this little function. Instead of "Response.Write strTempName" I used "PropCase = strTempName".

    Thanks for the code.
    • Post Points: 0
  • 12-29-2004 9:19 AM In reply to

    • keng
    • Not Ranked
    • Joined on 12-29-2004
    • New Member
    • Points 15

    Uppaer case first letter of each word in a string

    An alternative to do a similar thing but which possibly runs a lot faster:
    <%
    Function EIPropCase(EIString)
       ' Developed by Ken Good of Edge Impact Consulting Ltd, www.edgeimpact.co.uk
       ' This function will change the first letter of every word in a sting to upper case, for
       ' example the string "the west   wing is    where we practice karate" will be changed to
       ' "The West Wing Is Where We Practice Karate"
       Dim EIResultArray
       Dim EICnt
       EIResultArray = split(EIString," ")
       For EICnt = lbound(EIResultArray) to ubound(EIResultArray)
           EIPropCase = EIPropCase & " " & ucase(Left(EIResultArray(EICnt),1)) & mid(EIResultArray(EICnt),2)
       Next
       EIPropCase = mid(EIPropCase,2)
    End Function
    %>
    • Post Points: 0
  • 02-02-2005 12:25 AM In reply to

    Could your function be made to work with line feed

    Hi Ken,

    I found your function to proper case a string very useful. Would it be possible for the function to work if there were linefeeds in the string?

    E.G

    mr anyone
    15 anywhere street
    london

    This address string format confused the function a bit because of the linefeeds.

    How could the function be changed to deal with this type of string.

    Thank you.

    Colin
    • Post Points: 0
  • 09-16-2005 7:01 AM In reply to

    • floydfix
    • Not Ranked
    • Joined on 09-16-2005
    • New Member
    • Points 10

    Asp Capitalization of words

    I am fairly new to ASP and so forth,,  alot of learning....  been give the code to capitalize words of:

    <%
    Function PropCase(strTemp)
    Dim intFound
    Dim strTempName

    Do
      strTempName = strTempName & UCase(Left(strTemp, 1))
      strTemp     = Right(strTemp, Len(strTemp) - 1)
      intFound    = InStr(strtemp, " ")
      If intFound <> 0 Then
        strTempName = strTempName & Left(strTemp, intFound)
        strTemp = Right(strTemp, Len(strTemp) - intFound)
      Else
        strTempName = strTempName & strTemp
        Exit Do
      End If
    Loop While intFound <> 0
    Response.Write strTempName
    End Function
    %>

    When my users log on it says: welcome with the script <%
    response.write(Session("MM_Username"))
    %>!  I am trying to fit this code to capitalize with the code I already have and I am not sure how or where to place it.  

    I appreciate anybodys help that can offer it.  Thanks, Chuck
    • Post Points: 0
  • 09-16-2005 7:03 AM In reply to

    • floydfix
    • Not Ranked
    • Joined on 09-16-2005
    • New Member
    • Points 10

    asp capitalize words

    I am fairly new to ASP and so forth,,  alot of learning....  been give the code to capitalize words of:

    <%
    Function PropCase(strTemp)
    Dim intFound
    Dim strTempName

    Do
     strTempName = strTempName & UCase(Left(strTemp, 1))
     strTemp     = Right(strTemp, Len(strTemp) - 1)
     intFound    = InStr(strtemp, " ")
     If intFound <> 0 Then
       strTempName = strTempName & Left(strTemp, intFound)
       strTemp = Right(strTemp, Len(strTemp) - intFound)
     Else
       strTempName = strTempName & strTemp
       Exit Do
     End If
    Loop While intFound <> 0
    Response.Write strTempName
    End Function
    %>

    When my users log on it says: welcome with the script <%
    response.write(Session("MM_Username"))
    %>!  I am trying to fit this code to capitalize with the code I already have and I am not sure how or where to place it.  

    I appreciate anybodys help that can offer it.  Thanks, Chuck
    < Prev | 1 | Next >

     
    • Post Points: 0
Page 1 of 1 (6 items)