String N-Gram Function

I've written a small function that calculates unique n-grams from a given string of a given size.