Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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.

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Posted

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

Howzit??
Posted

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

.nerd
Posted
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".

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

  • Moderators
Posted

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

Visit...Bassic Software
Posted
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!
  • *Experts*
Posted

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.

Posted

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...

Howzit??

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...