 |

03-28-2007, 09:07 AM
|
|
Freshman
|
|
Join Date: Mar 2003
Posts: 35
|
|
How to get my capital letter back?
|
I need some help please.
I have some cipher text, like Abc dEf ghI for example. In order to simplify deciphering, i convert all to lower case.
Therefore, my decoded message become like: i am a boy.
Anyone can advice me how to retain or get back the cap letter, for example my original msg is: I am a Boy.
-----------------------------
For my deciphering,
I put letter a-z into an array.
I make sure the cipher letter match letter in my array, then i decipher using the keyword.
I'm thinking of making another array for cap letter A-Z, so i dont need to convert to lowercase beforehand; but i feel that's very stupid becos each cipher text letter i need to comare again 52 letter!
Anyone advice, thank!
|
|

03-28-2007, 10:05 AM
|
 |
Centurion
|
|
Join Date: Aug 2006
Location: Portugal
Posts: 120
|
|
|
Lcase is to put in lower case
Ucase is to put in upper case
did that help?
|
__________________
Google is your friend | xtremeVBtalk.com is also your friend :D
|

03-28-2007, 10:42 AM
|
|
Contributor
|
|
Join Date: Oct 2006
Posts: 483
|
|
|
Hello,
Lcase and Ucase would modify the whole text...
I presume you are looking for using back to Ucase only for the letters which were on Ucase before the transformation of the whole text using Lcase !
It sounds like homework to me...
I will then content myself by saying that you need to use a loop before the Lcase transformation and to memorize the position of each letter affected by lowcase ...
It's easy...
|
|

03-28-2007, 11:02 AM
|
|
Senior Contributor
Forum Leader
|
|
Join Date: Oct 2003
Location: Central Florida
Posts: 1,205
|
|
|
If you still have the original (encoded) string, you could step through it one character at a time (Mid$() function, checking the ascii (Asc() function) value of each character. If that number indicates a capital, then cap the corresponding letter in the new (decoded) string as you step through in parallel.
EDIT: If you'v already got each character in an array cell, that's even easier. You don't need Mid$() at this point: just loop through your array.
|
__________________
-- D.J.
I do not endorse any items advertised within this frame, and regret that the viewer is subjected to such.
|

03-29-2007, 09:46 AM
|
|
Freshman
|
|
Join Date: Mar 2003
Posts: 35
|
|
|
Thk to all who replied to my thread. moa, ElderKnight and madcat1990.
hi moa, you're half right, this is not my homework, if it is, i properly wont even post, haha. It's my assignment.
Btw, i found a solution, it took me almost a day to figure out this simple solution, i nearly wan to hit myself for such an easy thing.
All i have to do is before before my Lcase code, i put a boolean, ya just 1 line, a boolean........
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|