File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Is there a way to ask if a string only 1 character (any 1 character) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Is there a way to ask if a string only 1 character (any 1 character)" Watch "Is there a way to ask if a string only 1 character (any 1 character)" New topic
Author

Is there a way to ask if a string only 1 character (any 1 character)

Nick Rowe
Ranch Hand

Joined: May 26, 2010
Posts: 88
basically i need to search to check if an everchanging string contains more than one character, not a specific one but any SINGLE character in general.

This is as im attempting to return a word value and am getting the odd single character returned occasionally.
Its just a bit more error trapping.

regards S
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38046
    
  22
Yes. Go through the String API and there are methods telling you how many characters there are.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a way to ask if a string only 1 character (any 1 character)
 
Similar Threads
regex replacement
convert a string into character array
Unicode Character
How to replace apostophes?
what is the meaning of below regular expression