1st char UCase - rest LCase?

Results 1 to 7 of 7

Thread: 1st char UCase - rest LCase?

  1. #1
    maniacalloon Guest

    Default 1st char UCase - rest LCase?

    Is there a way to make the first letter of a text string UCase and the rest of it LCase? Any insight is greatly appreciated!<BR><BR> ~maniacalloon

  2. #2
    Join Date
    Dec 1969

    Default RE: 1st char UCase - rest LCase?

    Write a function to do your work.<BR><BR>Use Ucase & Lcase.<BR><BR>Anita

  3. #3
    Oanh Guest

    Default RE: 1st char UCase - rest LCase?

    You might try something like this:<BR><BR>&#060;%<BR>ucase(left(text,1) & lcase(right(text,(length(text)-1)))<BR>%&#062;

  4. #4
    maniacalloon Guest

    Default A little explanation?

    I am fairly new to ASP. I figured out a way to do what I want by making the entire string lowercase, and then making the first character uppercase. I couldn&#039t get the last part of the code you gave me to work right. I get "Type mismatch: &#039length&#039". Even though I found a way to do what I need, I was hoping you could show me how to get your code to work because it looks interesting. If you don&#039t mind. Thanks!<BR><BR> ~maniacalloon

  5. #5
    maniacalloon Guest

    Default Oops! forgot code

    Here&#039s the code I&#039ve got to test this out:<BR><BR>&#060;%<BR>text = "mAnIAcaL"<BR>Response.Write text<BR>text = ucase(left(text,1)) & lcase(right(text,(length(text)-1)))<BR>Response.Write text<BR>%&#062;

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

    Default What is length?? Try "LEN" <eop>


  7. #7
    maniacalloon Guest

    Default that works!

    Works great! Thanks1<BR><BR> ~maniacalloon

Posting Permissions

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