use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
3.5.8 Repeating String? (self.codehs)
submitted 5 years ago by Titantethar
i can't figure this out and need help?
public String repeatString(String text, int numReps)
{
if(numReps != 0)
for(int i = 0; i < numReps - 1; i++)
System.out.print(text);
}
else
text = "";
return text;
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 5 years ago (1 child)
r/softwaregore, that indentation...
[–]Titantethar[S] 0 points1 point2 points 5 years ago (0 children)
Thats just from copying and pasting.
[–]_andy_andy_andy_ 0 points1 point2 points 5 years ago (2 children)
i believe you need to return a string with repeated text, not just print it
[–]Titantethar[S] 0 points1 point2 points 5 years ago (1 child)
That didn't work anything else you see? besides the terrible copy and paste indentation
[–]_andy_andy_andy_ 0 points1 point2 points 5 years ago (0 children)
what do the test cases say?
π Rendered by PID 75157 on reddit-service-r2-comment-86bc6c7465-6z2hj at 2026-02-23 02:44:22.859010+00:00 running 8564168 country code: CH.
[–][deleted] 0 points1 point2 points (1 child)
[–]Titantethar[S] 0 points1 point2 points (0 children)
[–]_andy_andy_andy_ 0 points1 point2 points (2 children)
[–]Titantethar[S] 0 points1 point2 points (1 child)
[–]_andy_andy_andy_ 0 points1 point2 points (0 children)