Help with Replace

Results 1 to 2 of 2

Thread: Help with Replace

  1. #1
    Greg Mior Guest

    Default Help with Replace

    Hi,<BR><BR>I have a variable being passed through the URL (QueryString), called page.<BR><BR>if the page variable started with a small letter (not capitalized), how would I go about changing it to a Capital verson of the same letter.<BR><BR>EG.<BR>If the string was: page.asp?page=small<BR><BR>how would i go about converting the &#039s&#039 in small to an &#039S&#039 forming &#039Small&#039?<BR><BR>Thanks,<BR>Greg Mior

  2. #2
    Join Date
    Dec 1969

    Default No...UCase and LCase...see the docs

    So to get the string in the first place, you will do<BR><BR>pageValue = Request.QueryString("page")<BR><BR>Right? <BR><BR>If you want to convert the entire string to upper case, just do<BR><BR>pageValue = UCase( pageValue )<BR><BR>or to convert the whole thing to lower case<BR><BR>pageValue = LCase( pageValue )<BR><BR>But if you want "Small" -- always first letter caps, rest lower case -- do:<BR><BR>pageValue = UCase( Left(pageValue,1) ) & LCase( Mid(pageValue,2) )<BR><BR>See docs on Left and Mid to see why that works.<BR><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