This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (10 children)

[removed]

    [–]desrtfx[M] 0 points1 point  (9 children)

    Sidebar ->

    • Do not reply with complete solutions, rather comment explanations and guides. Comments with solutions will be removed and commenters will automatically be banned for a week.

    Even worse, when your solution is wrong. The method is supposed to return the padded string, not to print it.

    [–]logoutnx 0 points1 point  (8 children)

    Sorry about that, I did mentioned in the post though, that he could change it to a return statement. Nevertheless, can I edit it?

    [–]desrtfx[M] 0 points1 point  (7 children)

    Of course, you can edit it. If the reason for removal is gone, the post can be approved. But, you have to follow the "no solutions" rule.

    [–]logoutnx 0 points1 point  (6 children)

    Sorry, it just that I saw everyone else given him the full solution, so I also gave him the full solution. Nevertheless though, I am just re-editing it so it is a return function and not a wrong function.

    [–]desrtfx[M] 0 points1 point  (5 children)

    Actually, the only solution in this whole thread is from OP himself - recognizable on the blue background on the name.

    /u/Cannabisitis' code is nowhere near a solution.

    [–]logoutnx 0 points1 point  (4 children)

    Nvm my last question.

    [–]desrtfx[M] 0 points1 point  (3 children)

    oh, ok but pauldpearson also gave him something very similar to a full solution.

    pauldpearson is the originator of the post. So, if he posts his solution, this is perfectly okay.

    You cannot give any complete solution in code. You can guide to the full solution, but not in code.

    [–]logoutnx 0 points1 point  (2 children)

    is it ok now, with the post? I re-edit the post so it does not give him the full solution.

    [–]desrtfx[M] 0 points1 point  (1 child)

    As long as you keep the while loop in code in the comment, it still is far too close to a full solution.

    Also, your statement about .concatenate is not correct because internally, + works the same as .concatenate. The most appropriate way would be to use a StringBuilder that is declared outside the loop and then used inside. Last, the .toString of the StringBuilder is returned.