krupini
asked on
How to add characters or strings to a string?
string text = "";
string add = "badger";
I want some function so that 'text' would equal to "badgerbadgerbadgerbadger. .." and so on. The 'add' would be inserted into 'text' a specified amount of times.
I have tried the 'Insert()' function, but it does not seem to work. Thanks!
string add = "badger";
I want some function so that 'text' would equal to "badgerbadgerbadgerbadger.
I have tried the 'Insert()' function, but it does not seem to work. Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
{
string temp = "";
for(int i = 0; i<numberofadds; i++)
{
temp += stringtoadd;
}
return temp;
}