Guest_imported
New member
- Jan 1, 1970
- 0
Hi, I'm a beginner and I have a problem.
I have this variable which contains (usually/hopefully) a sentence. I would like to add random words to different places in the sentence. To be more specific, I would like to add a random word [FOO, BAR or COOL] after the fourth, seventh and tenth word of the sentence..
For example:
Sentence:
Tek-Tips is the hot web community where computer professionals meet and talk.
Result:
Tek-Tips is the hot BAR web community where COOL computer professionals meet FOO and talk.
If the sentence was longer, the random word would be placed with intervals of three (actually everywhere in the sentence except in the beginning, where it is placed after the fourth word).
I hope I'm understood.
So, how can this be achieved?? I'm a newbie so I would appreciate an example.
I have this variable which contains (usually/hopefully) a sentence. I would like to add random words to different places in the sentence. To be more specific, I would like to add a random word [FOO, BAR or COOL] after the fourth, seventh and tenth word of the sentence..
For example:
Sentence:
Tek-Tips is the hot web community where computer professionals meet and talk.
Result:
Tek-Tips is the hot BAR web community where COOL computer professionals meet FOO and talk.
If the sentence was longer, the random word would be placed with intervals of three (actually everywhere in the sentence except in the beginning, where it is placed after the fourth word).
I hope I'm understood.
So, how can this be achieved?? I'm a newbie so I would appreciate an example.