Mm..I found a way using Tokens. But does anyone now know like..taking in blanks, apostrophe, exclamation mark etc. and printing it out again?
Truth is; I'm trying to do a simple encryption method.
e.g. FLEE!! would be equals to NZAA!!
I've managed to split the words and change it but I do not know how to carry the !! or ' forward and output it..Anyone can help?
Currently for changing the output into a simple encryption I'm using if..else. If anyone has a better suggestion please comment ;)
Tokens? If you're using StringTokenizer, don't. Use the .toCharArray() method that hooknc mentioned.
Loop through each character using a FOR loop and determine if it's either a letter that should be changed or a symbol that should stay the same. You can do this by checking the characters' ASCII value.
int ascii = (int)character
if ((ascii > 64) && (ascii < 91))
//the character is between capital A and capital Z