This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes seeing id string has odd / even chars 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
Reply locked New topic
Author

seeing id string has odd / even chars

dale con
Ranch Hand

Joined: Apr 15, 2005
Posts: 93
hi all

i can find the length of a string

String s = "mystringodd";

can someone show me how i can then see if the string conains an even number of characters

e.g String s contains 11 chars

whati want to do is see if String s is even, if not i need to append a 0 to make it even, so string s becomes this 0mystringodd

can anyone help me ou with this


many thanks
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Duplicate post ... answered the other one.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
jQuery in Action, 2nd edition
 
subject: seeing id string has odd / even chars
 
Similar Threads
convert an array of String to char
Remove Chars from a String?
Looking for a leg up on an Anagram algorithm
Chinese (��?������?)
seeing id string has odd / even chars