Results 1 to 5 of 5

Thread: How Do You See If Letter Is Upper Case Or Lower?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Posts
    14

    Post

    I need a way to check if a character is upper case or lower case or is there a way in vb to reverse the case of a string like if it were

    hELLO it would change to Hello
    ?
    and vica versa

  2. #2
    Guest

    Post

    Code:
    Option Compare Binary
    If temp = UCASE(temp) Then 
       'temp is uppercase
    Else
       'temp is lowercase
    End If
    ------------------
    Boothman
    There is a war out there, and it is about who controls the information, it's all about the information.



    [This message has been edited by Boothman_7 (edited 01-28-2000).]

  3. #3
    New Member
    Join Date
    Jan 2000
    Posts
    6

    Post

    Yo Eric my man!

    To convert from hELLO to Hello, you might need to write your own chunktastic function baby, coz there ain't no built in one me thinks!

    As 65-90 is A-Z, and 97-122 is a-z, it should be quite simple to get the character's ASCII code, and convert to it's opposite partner.

    Check out the Asc function for the low down man

    Later,



    ------------------
    Regards,
    The Chunkster

    I appologise for my extrovert behaviour

    Remeber, Mr Chunky is funky!


  4. #4
    Guest

    Post

    if you want to make it proper case (ie the first letter alwasy capped you can format to the vbpropercase. And the is ucase as said before

  5. #5
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Calgary Alberta
    Posts
    359

    Post

    To borrow mr Chunky's example:

    strTemp = character you're checking

    if asc(strtemp) > 64 and asc(strtemp) < 91 then
    strtemp = chr(asc(strtemp) + 32)
    elseif asc(strtemp) > 96 and asc(strtemp) < 123 then
    strtemp = chr(asc(strtemp) - 32)
    end if

    add 32 to the asc value of a capital will give you the lower cased letter, subtracting 32 will give you the captial.


Posting Permissions

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



Click Here to Expand Forum to Full Width