Still upper to lower

renegade

Member
Joined
Feb 14, 2003
Messages
12
Lower to Uppper

Im new to VB.Net and need Help!!
How do change text from lower case to upper case and upper case to lower case without using VB.Nets predefined functions?
 
This is a very strange request. Why would you want to (unless its an excercise for school/college/etc)?


PS. Please dont post the same question to multiple forums - just choose the one that is most appropriate or use the general forum.
 
I dont see why it would be that strange of a request :confused:
What you can use is:
Code:
dim myString as string = "myvalue"

now you can use
myString.ToUpper()
or
myString.ToLower()

Cheers
 
In Short ...

Private offset as integer = asc("A") - asc("a")

and then

Code:
dim lower, upper as char (string * 1 whatever)

if upper >= asc("A") then
lower = chr(asc(upper)-offset)
end if

 *** 
if lower <=  asc("z") then
upper = chr(asc(lower)+offset)
end if
 
I posted this in your other thread (PLEASE dont multi-post)

Anyway, I didnt want to waste mine...

you can use Asc() and add 32 for lower and minus 32 for upper

Why dont you use the toUpper
 
Im still working on a problem for a VB.Net intro class and our problem is : To have an input box to enter text, two buttons, one to convert to upper case and the other to convert to lower case and display in another text box, without use of VBs predifined functions, ToLower, ToUpper. I need some direction, I dont want someone to hand me a solution I just need to help with the code and order of procedures. Help!
 
When a character is lower case, then bit 32 of its ASCII code will
be on; Notice that the ASCII character A has a code
of 65, and a has a code of 97; exactly 32 apart.

You will need to convert the string to a byte array and use the proper
bitwise operators (Or and And Not) to set bit 32 on the
character.
 
Back
Top