Hi,
I have attempted to answer this question but where have I gone wrong?
Return the given string doubled (concatenated with itself) , it should be doubled as many times as possible without exceeding the length given by limit. The string should be doubled a minimum of once, regardless of limit.
I have attempted to answer this question but where have I gone wrong?
Return the given string doubled (concatenated with itself) , it should be doubled as many times as possible without exceeding the length given by limit. The string should be doubled a minimum of once, regardless of limit.
Code:
public static string DoubleString(string aString, int limit)
{
do
{
string.Concat(aString, aString);
} while (aString.Length <= limit);
return aString;
}
}
Comment