http://www.perlmonks.org?node_id=616982


in reply to Re^2: finding number of contiguous letters
in thread finding number of contiguous letters

<picky_mode>
Only assuming the string does not contain whitespace.
</picky_mode>

Why so? If we're dealing with plain sequences of letter from an alphabet, of which one thing called "whitespace" is part, than the latter should not be special in anyway. If you have some paticular application in mind, then YMMV. To quote from Wikipedia:

For sequences of characters, the 3-grams (sometimes referred to as "trigrams") that can be generated from "good morning" are "goo", "ood", "od ", "d m", " mo", "mor" and so forth. Some practitioners preprocess strings to remove spaces, most simply collapse whitespace to a single space while preserving paragraph marks.
  • Comment on Re^3: finding number of contiguous letters

Replies are listed 'Best First'.
Re^4: finding number of contiguous letters
by andreas1234567 (Vicar) on May 23, 2007 at 12:04 UTC
    I always thought whitespace was not a letter. I guess I was wrong.