renegade Posted February 14, 2003 Posted February 14, 2003 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? Quote
TechnoTone Posted February 14, 2003 Posted February 14, 2003 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. Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
Cywizz Posted February 14, 2003 Posted February 14, 2003 I don't see why it would be that strange of a request :confused: What you can use is: dim myString as string = "myvalue" 'now you can use myString.ToUpper() 'or myString.ToLower() Cheers Quote Howzit??
Heiko Posted February 14, 2003 Posted February 14, 2003 In Short ... Private offset as integer = asc("A") - asc("a") and then 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 Quote .nerd
TechnoTone Posted February 14, 2003 Posted February 14, 2003 I don't see why it would be that strange of a request :confused: Because Renegade asked for a solution that didn't involve "VB.Net's predefined functions". Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
Moderators Robby Posted February 14, 2003 Moderators Posted February 14, 2003 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 Quote Visit...Bassic Software
Moderators Robby Posted February 14, 2003 Moderators Posted February 14, 2003 TechnoTone, that's exactly what I understood. Quote Visit...Bassic Software
renegade Posted February 15, 2003 Author Posted February 15, 2003 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! Quote
*Experts* Volte Posted February 15, 2003 *Experts* Posted February 15, 2003 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. Quote
Cywizz Posted February 18, 2003 Posted February 18, 2003 TT: Because Renegade asked for a solution that didn't involve "VB.Net's predefined functions". Sorry man, re-read the original post.....me bad... Quote Howzit??
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.