Bookmark Topic Watch Topic
  • New Topic

seeing id string has odd / even chars

 
dale con
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Report post to moderator
Duplicate post ... answered the other one.
 
    Bookmark Topic Watch Topic
  • New Topic