Re: A better way to write this function? (style question)

2013-12-30 Thread Thomas Gann
Thanks for all your replies, guys! I have done some further research in the meantime and I have found out that I am, in fact, an idiot. There is actually a standard library function that does exactly what I am trying to do! As it turns out, std.string.split(): 1) It automatically discards emp

A better way to write this function? (style question)

2013-12-30 Thread Thomas Gann
I've written a Markov bot in D, and I have function whose job it is to take an input string, convert all newline characters to spaces and all uppercase letters to lowercase, and then return an array of words that are generated by splitting the string up by whitespace. Here is the function is qu