How to append a character to all the strings in empty StringBuilder using for loop in C#

1 Answer

0 votes
using System;
using System.Text;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder(13);

            for (int i = 0; i < 13; i++)
                sb.Append('*');

            string s = sb.ToString();

            Console.WriteLine(s);
        }
    }
}


/*
run:
  
*************
 
*/

 



answered Jan 10, 2017 by avibootz

Related questions

1 answer 130 views
1 answer 159 views
1 answer 172 views
1 answer 157 views
1 answer 138 views
1 answer 176 views
...