C# StringBuilder Append(String, Int32, Int32)
Description
StringBuilder Append(String, Int32, Int32)
Appends
a copy of a specified substring to this instance.
Syntax
StringBuilder.Append(String, Int32, Int32)
has the following syntax.
public StringBuilder Append(
string value,/*from w w w. j a v a 2 s . c o m*/
int startIndex,
int count
)
Parameters
StringBuilder.Append(String, Int32, Int32)
has the following parameters.
value
- The string that contains the substring to append.startIndex
- The starting position of the substring within value.count
- The number of characters in value to append.
Returns
StringBuilder.Append(String, Int32, Int32)
method returns A reference to this instance after the append operation has completed.
Example
//from w w w. jav a2 s . c o m
using System;
using System.Text;
using System.Globalization;
class Sample
{
public static void Main()
{
string str = "this is a test;";
int index = 0;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(str, index, 1);
}
}