Generate subsets using bitmasking

Can you please share the code of how to generate substrings from a given string ?
please note that its substring that I am talking about.
Thanks…

See subsets and substrings are very different things.
In subsets you 2 possibilities for very element so we take 2^n where n is number of bits or chars in it so we use bitmasking and doing it is useful because it is way to do it iteratively.
In case of substrings doing this is not useful at all and not even required because you can simply do it using 2 loops.
But if you want to do that then you can give it a try on your own, just do the same as for bitmasking and while checking the set bits only take those cases when the bits which are set, are adjacent only i.e combinations like 11000, 00110, 0011 are accepted but like 10010, 110011 are not accepted(as you know what is substring)