c# stringbuilder
using System;
using System.Text;
public sealed class App
{
static void Main()
{
// Create a StringBuilder that expects to hold 50 characters.
// Initialize the StringBuilder with "ABC".
StringBuilder sb = new StringBuilder("ABC", 50);
// Append three characters (D, E, and F) to the end of the StringBuilder.
sb.Append(new char[] { 'D', 'E', 'F' });
// Append a format string to the end of the StringBuilder.
sb.AppendFormat("GHI{0}{1}", 'J', 'k');
// Display the number of characters in the StringBuilder and its string.
Console.WriteLine("{0} chars: {1}", sb.Length, sb.ToString());
// Insert a string at the beginning of the StringBuilder.
sb.Insert(0, "Alphabet: ");
// Replace all lowercase k's with uppercase K's.
sb.Replace('k', 'K');
// Display the number of characters in the StringBuilder and its string.
Console.WriteLine("{0} chars: {1}", sb.Length, sb.ToString());
}
}
// This code produces the following output.
//
// 11 chars: ABCDEFGHIJk
// 21 chars: Alphabet: ABCDEFGHIJK
Also in C#:
- findobject getcomponent
- fieldconverter c#
- c# form set auto scale
- Random number unity
- csharp first element of array
- c# one line set
- how to convert object in string JSON c#
- Assets/Scripts/Snake.cs(177,25): error CS1061: Type `Snake.SnakeBodyPart' does not contain a definition for `SetGridPostion' and no extension method `SetGridPostion' of type `Snake.SnakeBodyPart' could be found. Are you missing an assembly reference?
- s3 upload base64 .net core
- transform object according to its parent unity
- c# pull request
- c# make http request
- lat long data type c#
- How to solve error in ExecuteNonQuery() in asp.net
- how to add a componet to a gameobject throgh code unity
- unity quaternion identity
- how to make game unity c#
- unity3d debug pause
- asp.net core mvc not triggering client side validation
- snake game
- c# Sleep
- how to trigger event when a com device is connected in c#
- what does gameobject.find return
- generics in c#