Still upper to lower

renegade

Newcomer
Joined
Feb 14, 2003
Messages
12
Lower to Uppper

I'm 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.Net's predefined functions?
 
This is a very strange request. Why would you want to (unless it's an excercise for school/college/etc)?


PS. Please don't post the same question to multiple forums - just choose the one that is most appropriate or use the general forum.
 
I don't see why it would be that strange of a request :confused:
What you can use is:
Visual Basic:
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

Visual Basic:
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 don't multi-post)

Anyway, I didn't want to waste mine...

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

Why don't you use the toUpper
 
I'm 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 VB's predifined functions, ToLower, ToUpper. I need some direction, I don't 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