My original code already ignores spaces, did you really try it?

That's not an algorithm, but a random example which is useless.

An algorithm means you explain how the function that is to be coded, decides how to act in what circumstance, along with the limitations.

Example would be:

"I want to have the following with strings with less than 3 words:

1 letter in first word
2 letters in all the following words
1 letter in last word

this will increment with each try, meaning

2 in first word
3 in rest except last
2 in last

When there are more than 3 words, then I would like the following:

I want to show 10% of the first word, but only if the word is shorter than 6 chars, otherwise I want to show 15%
...

When there are over 7 words, I want to show the first 2 letters of each word, and increment with a random number between 1 and 2 with each try, on each word.
etc etc etc"

Do you see the difference with what you gave me and what I just did?

Btw you first said you wanted to show more in case of 10 letter words or something, but strangely enough in your example, the longest word has less letters shown than the first one which is shorter... the last word is of same length as the first, yet surprisingly it shows less letters...

I'm going to leave the help with this to someone else, atleast until you have made up your mind and did some work yourself, being thinking up an algorithm to fit your needs.

Greets


Gone.