I need help for this exercise:
Inside the Test class, you must create a public method called copyText that takes a text as input and answer with a text.
It must answer with the same text put together as many time as there is characters in the input text.
Ex: in("car") out "carcarcar";
Ex: in("it") out "itit";
Ex: in("love") out "lovelovelovelove";
Ex: in("coffe") out "coffecoffecoffecoffecoffe";
I have tried to make a solution, where I find the Length of the word,
but I can't figure out to do this part:
Answer with the same text put together as many time as there are characters:
class Program
{
static void Main(string[] args)
{
Test k = new Test();
string carText = k.copyText("car");
Console.WriteLine(carText.Length);
}
}
class Test
{
public string copyText(string text)
{
return text;
}
}