Results 1 to 3 of 3
Thread: special characters
- 11-15-2007, 06:01 PM #1
Senior Member
- Join Date
- Nov 2007
- Posts
- 115
- Rep Power
- 0
special characters
I am writing a parser. I have a character and want to know what it is (number, letter, special character etc).
Special characters are %, &, /, (, ), = etc. Is there any method in Character class that I can use :confused:Java Code:char ch = 'a'; if (Character.isLetter(ch)) { ... } if (Character.isDigit(ch)) { // false ... } if (Character.isLowerCase(ch)) { // true ... } if (Character.isUpperCase(ch)) { // false ... }
Thanks in advance.
- 11-15-2007, 06:36 PM #2
Not to my knowledge. You could create an Array, List or String containing the hex values of all the special characters that you want. Then just check to see if your characters is in the dataset.
I would personally just do it with a String and use the indexOf method. That's just me though.
- 11-16-2007, 01:28 PM #3
Senior Member
- Join Date
- Nov 2007
- Posts
- 111
- Rep Power
- 0
Similar Threads
-
characters + strings
By Gilgamesh in forum New To JavaReplies: 3Last Post: 03-02-2008, 09:10 PM -
Convert some special characters stored in a MySql
By romina in forum JDBCReplies: 1Last Post: 08-07-2007, 05:32 AM -
show special symbol using its Unicode character
By christina in forum AWT / SwingReplies: 1Last Post: 07-25-2007, 09:21 AM -
Special characters in text fields
By Felissa in forum Web FrameworksReplies: 0Last Post: 06-27-2007, 04:47 PM -
Getting all characters in a String
By Alayna in forum New To JavaReplies: 2Last Post: 05-20-2007, 11:49 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks