Jacob Sonia wrote:hi,
the output of this method would be
String input | String param1 | |
String input | | String param2|
String input |||
Why not
String input | String param1 | String param2 |
Why is that one left off?
I'll re-iterate what I said before. There are two pieces. your method needs to build all the possible pieces that can be added on, like this:
|||
param1||
||param2|
|param1|param2|
and then, for each one, it needs to append it onto the end of 'input'.
Note that you probably don't want a method signature of "inputString(String input, String param1, String param2) ". If you did it that way, you'd need a new method every time you wanted to add another param...
inputString(String input, String param1, String param2, String param3)
inputString(String input, String param1, String param2, String param3, String param4)
inputString(String input, String param1, String param2, String param3, String param4, String param5)
etc...
you probably want
inputString(String input, String [] pieces)
Then you write your method to process the pieces array.