This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Nick Rowe
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48445
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Go through the String API and there are methods telling you how many characters there are.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic