This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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: 55351
157
  • 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
Boost this thread!