| | |
String Splitter
![]() |
•
•
Join Date: Sep 2006
Posts: 7
Reputation:
Solved Threads: 0
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
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
Last edited by im4tion; Sep 3rd, 2006 at 2:23 pm.
•
•
Join Date: Mar 2004
Posts: 763
Reputation:
Solved Threads: 38
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
You can use this link to see what number ranges alpha-numeric characters are in.
http://www.lookuptables.com/
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
You can use this link to see what number ranges alpha-numeric characters are in.
http://www.lookuptables.com/
![]() |
Similar Threads
- String splitter (C)
Other Threads in the Java Forum
- Previous Thread: adding an image to a java code
- Next Thread: Character Frequency
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor crashcourse database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress integer intellij j2me java javadoc javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle plazmic print problem program programming project radio recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows





