Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    chars.substring(rnum, rnum + 1) => chars[rnum] Commented Dec 22, 2013 at 11:31
  • thanks, but this function is too long. Commented Dec 22, 2013 at 11:31
  • 2
    @Steve: Please, explain how a piece of code can be "too long"? Commented Dec 22, 2013 at 11:32
  • 1
    I don't understand. where does 'the shortest code logic' come from? This is a good function and the chance of returning duplicate word is very low. Commented Dec 22, 2013 at 11:36
  • 1
    Regarding, the accepted answer will be much longer when you need let's say 60 char long strings, and this still fits, I gave my vote for this answer. Commented Feb 26, 2021 at 14:37