Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Javascript (https://www.askmehelpdesk.com/forumdisplay.php?f=452)
-   -   Java string concatenation in the iteration (https://www.askmehelpdesk.com/showthread.php?t=802625)

  • Oct 8, 2014, 10:54 AM
    Besim
    Java string concatenation in the iteration
    Hi everyone can any help me with this:


    Make a program that asks for an integer and prints all integers from one to the entered integer. By performing a string concatenation in the iteration, let the label text value to be the value it had last lap plus the new century.

    Thanks to everyone for his time.
  • Oct 8, 2014, 11:16 AM
    CravenMorhead
    This won't compile:
    ----
    string entry;
    for(I = 1 to number)
    entry.append("%s %d",entry,number);
    ----

    It is simple to take an empty string, and run it through the loop. Each time through to append/concatenate the iterative number on the end.

  • All times are GMT -7. The time now is 01:45 PM.