How to write a rule which takes two input a char and an integer,ruleInput: (A,2)Output: (A1;A2)
anyone can give me the answer
Discussion posts and replies are publicly visible
The requirement is not clear. Share more details.
You can create a rule input of Text type and then pass comma-separated data in that.
Yogi Patel said:The requirement is not clear.
I like defaulting to the laziest approach possible when the requirements aren't actually spelled out. For instance, the result here is just a rule that returns "(A1;A2)", without specifying how the rule input (if any) is related to that (and my brain is too fried to try guessing).
So here's my initial rule suggestion:
"(A1;A2)"
Straightforwardness: 10/10. Flexibility for different rule inputs: ??/10.
Less lazy reply:
let's pretend the rule input is actually 2 inputs, a character and a "times repeated". I don't feel like writing a parser to accept a comma-separated value when that may have just been OP overly abbreviating what their input is going to be.
a!forEach( enumerate(ri!repeats), ri!character & fv!index )
For "A" and 2, that gives us basically their prescribed output:
For "C" and "11", it performs more of the same: