Hi,
I have a requirement where I need to generate the combinations of string based on some rules.
For Eg: I have a string like: [x | y] z [A]
Possible combinations are,
z,ZA,xz,xyz,xzA,yzA

The rules are,
1.[],| are symbols.
2.Any text inside [] is optional
eg: [x]
3.| means “or”
eg:;[x | y] – this means either “x” or “y”. Both cannot come together.
4.Any text outside [] is mandatory
eg: z
5. <> Means range and can be ignored eg:
<1-512> The text suffix to this operator must be treated as any other combination.

Can we store these rules in somewhere in configuration file and create combinations for the string based on these rules.
Is that possible in c#?
The string may vary in different formats as
[navigation] (destination ((point | points) of interest | POI) | find a (point of interest | POI) | find points of interest)
please help me out with this stuff.

Of course it is possible. Write a parser for your rules. What have you got so far?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.