jeudi 5 novembre 2015

Insert string randomly into another string

Does anyone have a good method for inserting all items from a list randomly into another string? For example if I have paragraph of text and I want to insert urls randomly after sentences. The Urls are stored in a list object. How would I go about doing this? I was thinking I could count the number of periods and other punctuation, but I would somehow have to store the location of each period as well. If anyone could point me in the right direction i would appreciate it.




Aucun commentaire:

Enregistrer un commentaire