How to append (add) strings to StringBuilder 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();

            sb.Append("c#");
            sb.AppendLine();
            sb.Append("java").AppendLine();
            sb.Append("c++");

            Console.WriteLine(sb);
        }
    }
}

/*
run:
  
c#
java
c++

*/

 



answered Jan 15, 2017 by avibootz

Related questions

1 answer 157 views
1 answer 139 views
1 answer 130 views
1 answer 99 views
1 answer 130 views
1 answer 115 views
115 views asked Jan 16, 2017 by avibootz
...