aspose file tools*
The moose likes Beginning Java and the fly likes Passing String to Character IS-A Methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Passing String to Character IS-A Methods" Watch "Passing String to Character IS-A Methods" New topic
Author

Passing String to Character IS-A Methods

Graeme Byers
Ranch Hand

Joined: Apr 16, 2004
Posts: 127
Is there are better way than this ?
String aLetter = "A" ;
char [] charArray = new char[1] ;
charArray = aLetter.toCharArray() ;
boolean b = Character.isLetter(charArray[0]) ;
Thank you.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18135
    
    8

Using the "charAt(int)" method of String would reduce the number of lines of code in that example.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing String to Character IS-A Methods
 
Similar Threads
Arrays
Read operation failed from Socket.
how do you convert CHAR TO STRING
different question relating to the recursion
How to read the complete contents of a file in a String?!