id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

String OperationsConcat5

prev  |  next  |  chance
public static String combine(int t, String s) {
    String result = "";

    for (int i = 0; i < t; i++)
        result += s;

    return result;
}
Function Call  Return Value
combine(3, "Car")
combine(1, "Hello")
combine(4, "5")
combine(5, "ree")
combine(3, "Hi")
combine(4, "bat")
combine(5, "")
combine(4, " ")
combine(0, "abc")

Experiment with this code on Gitpod.io

⬅ Back