mmport80
Stream Data Min String Length Filter
I am trying to generate strings which pass a rule, e.g.
1 < length(string) < 10
So I am using,
StreamData.string( … ) |> StreamData.filter(..)
but, for some reason, I see the data sent thru the filter is always a single character.
The filter filters out everything…
Of course, without the filter, I rarely see single character outputs.
Obviously I am missing something.
The filter in this case is for individual generated characters, instead of complete strings(?)
Marked As Solved
NobbZ
I am just realising, that StreamData.string/2s documentation tells you that it shares options with StreamData.list_of/2. There we have :min_length and :max_length options. So StreamData.string(:ascii, min_length: 2, max_length: 9) should be totally fine.
Also Liked
NobbZ
Can you please provide a full example of the “generator” you use and its output?







