.NETFramework:StringBuilder
ylbtech-System.Text.StringBuilder.cs |
1.程序集 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089返回顶部 |
#region 程序集 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll
#endregion using System.Reflection;
using System.Runtime;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security; namespace System.Text
{
//
// 摘要:
// 表示可变字符字符串。此类不能被继承。
[ComVisible(true)]
[DefaultMember("Chars")]
public sealed class StringBuilder : ISerializable
{
//
// 摘要:
// 初始化 System.Text.StringBuilder 类的新实例。
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public StringBuilder();
//
// 摘要:
// 使用指定的容量初始化 System.Text.StringBuilder 类的新实例。
//
// 参数:
// capacity:
// 此实例的建议起始大小。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// capacity 小于零。
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public StringBuilder(int capacity);
//
// 摘要:
// 使用指定的字符串初始化 System.Text.StringBuilder 类的新实例。
//
// 参数:
// value:
// 用于初始化实例值的字符串。如果 value 为 null,则新的 System.Text.StringBuilder 将包含空字符串(即包含 System.String.Empty)。
public StringBuilder(string value);
//
// 摘要:
// 使用指定的字符串和容量初始化 System.Text.StringBuilder 类的新实例。
//
// 参数:
// value:
// 用于初始化实例值的字符串。如果 value 为 null,则新的 System.Text.StringBuilder 将包含空字符串(即包含 System.String.Empty)。
//
// capacity:
// System.Text.StringBuilder 的建议起始大小。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// capacity 小于零。
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public StringBuilder(string value, int capacity);
//
// 摘要:
// 初始化 System.Text.StringBuilder 类的新实例,该类起始于指定容量并且可增长到指定的最大容量。
//
// 参数:
// capacity:
// System.Text.StringBuilder 的建议起始大小。
//
// maxCapacity:
// 当前字符串可包含的最大字符数。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// maxCapacity 小于一,capacity 小于零,或 capacity 大于 maxCapacity。
[SecuritySafeCritical]
public StringBuilder(int capacity, int maxCapacity);
//
// 摘要:
// 用指定的子字符串和容量初始化 System.Text.StringBuilder 类的新实例。
//
// 参数:
// value:
// 字符串,包含用于初始化此实例值的子字符串。如果 value 为 null,则新的 System.Text.StringBuilder 将包含空字符串(即包含
// System.String.Empty)。
//
// startIndex:
// value 中子字符串开始的位置。
//
// length:
// 子字符串中的字符数。
//
// capacity:
// System.Text.StringBuilder 的建议起始大小。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// capacity 小于零。- 或 -startIndex 加上 length 不是 value 中的位置。
[SecuritySafeCritical]
public StringBuilder(string value, int startIndex, int length, int capacity); //
// 摘要:
// 获取或设置此实例中指定字符位置处的字符。
//
// 参数:
// index:
// 字符的位置。
//
// 返回结果:
// index 位置处的 Unicode 字符。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 在设置一个字符时 index 在此实例的范围之外。
//
// T:System.IndexOutOfRangeException:
// 在获取一个字符时 index 在此实例的范围之外。
public char this[int index] { get; set; } //
// 摘要:
// 获取此实例的最大容量。
//
// 返回结果:
// 此实例可容纳的最大字符数。
public int MaxCapacity { get; }
//
// 摘要:
// 获取或设置当前 System.Text.StringBuilder 对象的长度。
//
// 返回结果:
// 此实例的长度。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 为设置操作指定的值小于零或大于 System.Text.StringBuilder.MaxCapacity。
public int Length { get; set; }
//
// 摘要:
// 获取或设置可包含在当前实例所分配的内存中的最大字符数。
//
// 返回结果:
// 可包含在当前实例所分配的内存中的最大字符数。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 为设置操作指定的值小于此实例的当前长度。- 或 -为设置操作指定的值大于最大容量。
public int Capacity { get; set; } //
// 摘要:
// 在此实例的结尾追加指定对象的字符串表示形式。
//
// 参数:
// value:
// 要追加的对象。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public StringBuilder Append(object value);
//
// 摘要:
// 在此实例的结尾追加指定数组中的 Unicode 字符的字符串表示形式。
//
// 参数:
// value:
// 要追加的字符数组。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Append(char[] value);
//
// 摘要:
// 在此实例的结尾追加指定的 64 位无符号整数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[CLSCompliant(false)]
public StringBuilder Append(ulong value);
//
// 摘要:
// 在此实例的结尾追加指定的 32 位无符号整数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[CLSCompliant(false)]
public StringBuilder Append(uint value);
//
// 摘要:
// 在此实例的结尾追加指定的 16 位无符号整数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[CLSCompliant(false)]
public StringBuilder Append(ushort value);
//
// 摘要:
// 在此实例的结尾追加指定的十进制数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Append(decimal value);
//
// 摘要:
// 在此实例的结尾追加指定的双精度浮点数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Append(double value);
//
// 摘要:
// 在此实例的结尾追加指定的单精度浮点数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Append(float value);
//
// 摘要:
// 在此实例的结尾追加指定的 32 位有符号整数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public StringBuilder Append(int value);
//
// 摘要:
// 在此实例的结尾追加指定的 16 位有符号整数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Append(short value);
//
// 摘要:
// 在此实例的结尾追加指定 Unicode 字符的字符串表示形式。
//
// 参数:
// value:
// 要追加的 Unicode 字符。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Append(char value);
//
// 摘要:
// 在此实例的结尾追加指定的 64 位有符号整数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Append(long value);
//
// 摘要:
// 在此实例的结尾追加指定的 8 位有符号整数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[CLSCompliant(false)]
public StringBuilder Append(sbyte value);
//
// 摘要:
// 在此实例的结尾追加指定的布尔值的字符串表示形式。
//
// 参数:
// value:
// 要追加的布尔值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Append(bool value);
//
// 摘要:
// 在此实例的结尾追加指定子字符串的副本。
//
// 参数:
// value:
// 包含要追加的子字符串的字符串。
//
// startIndex:
// value 中子字符串的开始位置。
//
// count:
// value 中要追加的字符数。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentNullException:
// value 为 null,并且 startIndex 和 count 不为零。
//
// T:System.ArgumentOutOfRangeException:
// count 小于零。- 或 -startIndex 小于零。- 或 -startIndex+count 大于 value 的长度。- 或 -增大此实例的值将超过
// System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Append(string value, int startIndex, int count);
//
// 摘要:
// 在此实例的结尾追加指定字符串的副本。
//
// 参数:
// value:
// 要追加的字符串。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Append(string value);
//
// 摘要:
// 在此实例的结尾追加指定的 Unicode 字符子数组的字符串表示形式。
//
// 参数:
// value:
// 字符数组。
//
// startIndex:
// value 中的起始位置。
//
// charCount:
// 要追加的字符数。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentNullException:
// value 为 null,并且 startIndex 和 charCount 不为零。
//
// T:System.ArgumentOutOfRangeException:
// charCount 小于零。- 或 -startIndex 小于零。- 或 -startIndex+charCount 大于 value 的长度。- 或
// -增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Append(char[] value, int startIndex, int charCount);
//
// 摘要:
// 在此实例的结尾追加 Unicode 字符的字符串表示形式指定数目的副本。
//
// 参数:
// value:
// 要追加的字符。
//
// repeatCount:
// 追加 value 的次数。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// repeatCount 小于零。- 或 -增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
//
// T:System.OutOfMemoryException:
// 内存不足。
[SecuritySafeCritical]
public StringBuilder Append(char value, int repeatCount);
//
// 摘要:
// 在此实例的结尾追加指定的 8 位无符号整数的字符串表示形式。
//
// 参数:
// value:
// 要追加的值。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Append(byte value);
//
// 摘要:
// 将通过处理复合格式字符串(包含零个或零个以上格式项)返回的字符串追加到此实例。每个格式项都替换为一个参数的字符串表示形式。
//
// 参数:
// format:
// 复合格式字符串。
//
// arg0:
// 要格式化的对象。
//
// 返回结果:
// 对追加了 format 的此实例的引用。format 中的每个格式项都替换为 arg0 的字符串表示形式。
//
// 异常:
// T:System.ArgumentNullException:
// format 为 null。
//
// T:System.FormatException:
// format 无效。- 或 -格式项的索引小于 0(零),或大于或等于 1。
//
// T:System.ArgumentOutOfRangeException:
// 扩展字符串的长度将超过 System.Text.StringBuilder.MaxCapacity。
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public StringBuilder AppendFormat(string format, object arg0);
//
// 摘要:
// 将通过处理复合格式字符串(包含零个或零个以上格式项)返回的字符串追加到此实例。每个格式项都替换为这两个参数中任意一个参数的字符串表示形式。
//
// 参数:
// format:
// 复合格式字符串。
//
// arg0:
// 要设置格式的第一个对象。
//
// arg1:
// 要设置格式的第二个对象。
//
// 返回结果:
// 对追加了 format 的此实例的引用。format 中的每个格式项都替换为相应对象参数的字符串表示形式。
//
// 异常:
// T:System.ArgumentNullException:
// format 为 null。
//
// T:System.FormatException:
// format 无效。- 或 -格式项的索引小于 0(零),或大于或等于 2。
//
// T:System.ArgumentOutOfRangeException:
// 扩展字符串的长度将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder AppendFormat(string format, object arg0, object arg1);
//
// 摘要:
// 将通过处理复合格式字符串(包含零个或零个以上格式项)返回的字符串追加到此实例。每个格式项都替换为这三个参数中任意一个参数的字符串表示形式。
//
// 参数:
// format:
// 复合格式字符串。
//
// arg0:
// 要设置格式的第一个对象。
//
// arg1:
// 要设置格式的第二个对象。
//
// arg2:
// 要设置格式的第三个对象。
//
// 返回结果:
// 对追加了 format 的此实例的引用。format 中的每个格式项都替换为相应对象参数的字符串表示形式。
//
// 异常:
// T:System.ArgumentNullException:
// format 为 null。
//
// T:System.FormatException:
// format 无效。- 或 -格式项的索引小于 0(零),或大于或等于 3。
//
// T:System.ArgumentOutOfRangeException:
// 扩展字符串的长度将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder AppendFormat(string format, object arg0, object arg1, object arg2);
//
// 摘要:
// 将通过处理复合格式字符串(包含零个或零个以上格式项)返回的字符串追加到此实例。使用指定的格式提供程序将每个格式项都替换为形参数组中相应实参的字符串表示形式。
//
// 参数:
// provider:
// 一个提供区域性特定的格式设置信息的对象。
//
// format:
// 复合格式字符串。
//
// args:
// 要设置其格式的对象的数组。
//
// 返回结果:
// 完成追加操作后对此实例的引用。完成追加操作后,此实例包含执行该操作之前已存在的任何数据,并且有一个 format 的副本作为后缀,其中任何格式规范都由相应对象参数的字符串表示形式替换。
//
// 异常:
// T:System.ArgumentNullException:
// format 为 null。
//
// T:System.FormatException:
// format 无效。- 或 -格式项的索引小于 0(零)或大于等于 args 数组的长度。
//
// T:System.ArgumentOutOfRangeException:
// 扩展字符串的长度将超过 System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder AppendFormat(IFormatProvider provider, string format, params object[] args);
//
// 摘要:
// 将通过处理复合格式字符串(包含零个或零个以上格式项)返回的字符串追加到此实例。每个格式项都替换为形参数组中相应实参的字符串表示形式。
//
// 参数:
// format:
// 复合格式字符串。
//
// args:
// 要设置其格式的对象的数组。
//
// 返回结果:
// 对追加了 format 的此实例的引用。format 中的每个格式项都替换为相应对象参数的字符串表示形式。
//
// 异常:
// T:System.ArgumentNullException:
// format 或 args 为 null。
//
// T:System.FormatException:
// format 无效。- 或 -格式项的索引小于 0(零)或大于等于 args 数组的长度。
//
// T:System.ArgumentOutOfRangeException:
// 扩展字符串的长度将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder AppendFormat(string format, params object[] args);
//
// 摘要:
// 将后面跟有默认行终止符的指定字符串的副本追加到当前 System.Text.StringBuilder 对象的末尾。
//
// 参数:
// value:
// 要追加的字符串。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[ComVisible(false)]
public StringBuilder AppendLine(string value);
//
// 摘要:
// 将默认的行终止符追加到当前 System.Text.StringBuilder 对象的末尾。
//
// 返回结果:
// 完成追加操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[ComVisible(false)]
public StringBuilder AppendLine();
//
// 摘要:
// 从当前 System.Text.StringBuilder 实例中移除所有字符。
//
// 返回结果:
// 其 System.Text.StringBuilder.Length 为 0(零)的对象。
public StringBuilder Clear();
//
// 摘要:
// 将此实例的指定段中的字符复制到目标 System.Char 数组的指定段中。
//
// 参数:
// sourceIndex:
// 此实例中开始复制字符的位置。索引是从零开始的。
//
// destination:
// 将从中复制字符的数组。
//
// destinationIndex:
// destination 中将从其开始复制字符的起始位置。索引是从零开始的。
//
// count:
// 要复制的字符数。
//
// 异常:
// T:System.ArgumentNullException:
// destination 为 null。
//
// T:System.ArgumentOutOfRangeException:
// sourceIndex、destinationIndex 或 count,小于零。- 或 -sourceIndex 大于此实例的长度。
//
// T:System.ArgumentException:
// sourceIndex + count 大于此实例的长度。- 或 -destinationIndex+count 大于 destination 的长度。
[ComVisible(false)]
[SecuritySafeCritical]
public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count);
//
// 摘要:
// 确保 System.Text.StringBuilder 的此实例的容量至少是指定值。
//
// 参数:
// capacity:
// 要确保的最小容量。
//
// 返回结果:
// 此实例的新容量。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// capacity 小于零。- 或 -增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public int EnsureCapacity(int capacity);
//
// 摘要:
// 返回一个值,该值指示此实例是否与指定的对象相等。
//
// 参数:
// sb:
// 与此实例进行比较的 object,或 null。
//
// 返回结果:
// 如果此实例和 sb 具有相等的字符串、System.Text.StringBuilder.Capacity 和 System.Text.StringBuilder.MaxCapacity
// 值,则为 true;否则,为 false。
public bool Equals(StringBuilder sb);
//
// 摘要:
// 将 16 位无符号整数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[CLSCompliant(false)]
public StringBuilder Insert(int index, ushort value);
//
// 摘要:
// 将对象的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的对象或 null。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Insert(int index, object value);
//
// 摘要:
// 将 64 位无符号整数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[CLSCompliant(false)]
public StringBuilder Insert(int index, ulong value);
//
// 摘要:
// 将 32 位无符号整数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[CLSCompliant(false)]
public StringBuilder Insert(int index, uint value);
//
// 摘要:
// 将十进制数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Insert(int index, decimal value);
//
// 摘要:
// 将布尔值的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Insert(int index, bool value);
//
// 摘要:
// 将单精度浮点数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Insert(int index, float value);
//
// 摘要:
// 将指定字符串的一个或更多副本插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的字符串。
//
// count:
// 插入 value 的次数。
//
// 返回结果:
// 完成插入后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的当前长度。- 或 -count 小于零。
//
// T:System.OutOfMemoryException:
// 此 System.Text.StringBuilder 对象的当前长度加上 value 的长度乘以 count 的值超过 System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Insert(int index, string value, int count);
//
// 摘要:
// 将双精度浮点数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Insert(int index, double value);
//
// 摘要:
// 将指定的 8 位带符号整数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[CLSCompliant(false)]
public StringBuilder Insert(int index, sbyte value);
//
// 摘要:
// 将指定的 8 位无符号整数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Insert(int index, byte value);
//
// 摘要:
// 将指定的 16 位带符号整数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Insert(int index, short value);
//
// 摘要:
// 将字符串插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的字符串。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的当前长度。- 或 -此 System.Text.StringBuilder 对象的当前长度加上 value 的长度超过 System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Insert(int index, string value);
//
// 摘要:
// 将指定的 Unicode 字符数组的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的字符数组。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。- 或 -增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Insert(int index, char[] value);
//
// 摘要:
// 将指定的 Unicode 字符子数组的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 字符数组。
//
// startIndex:
// value 内的起始索引。
//
// charCount:
// 要插入的字符数。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentNullException:
// value 为 null,并且 startIndex 和 charCount 不为零。
//
// T:System.ArgumentOutOfRangeException:
// index、startIndex 或 charCount 小于零。- 或 -index 大于此实例的长度。- 或 -startIndex 加上 charCount
// 不是 value 中的位置。- 或 -增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Insert(int index, char[] value, int startIndex, int charCount);
//
// 摘要:
// 将指定的 32 位带符号整数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Insert(int index, int value);
//
// 摘要:
// 将 64 位带符号整数的字符串表示形式插入到此实例中的指定字符位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。
//
// T:System.OutOfMemoryException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
public StringBuilder Insert(int index, long value);
//
// 摘要:
// 将指定的 Unicode 字符的字符串表示形式插入到此实例中的指定位置。
//
// 参数:
// index:
// 此实例中开始插入的位置。
//
// value:
// 要插入的值。
//
// 返回结果:
// 完成插入操作后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// index 小于零或大于此实例的长度。- 或 -增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Insert(int index, char value);
//
// 摘要:
// 将指定范围的字符从此实例中移除。
//
// 参数:
// startIndex:
// 此实例中开始移除操作的从零开始的位置。
//
// length:
// 要移除的字符数。
//
// 返回结果:
// 切除操作完成后对此实例的引用。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// 如果 startIndex 或 length 小于零,或者 startIndex+length 大于此实例的长度。
[SecuritySafeCritical]
public StringBuilder Remove(int startIndex, int length);
//
// 摘要:
// 将此实例中所有指定字符串的匹配项替换为其他指定字符串。
//
// 参数:
// oldValue:
// 要替换的字符串。
//
// newValue:
// 替换 oldValue 的字符串或 null。
//
// 返回结果:
// 对此实例的引用,其中 oldValue 的所有实例被 newValue 替换。
//
// 异常:
// T:System.ArgumentNullException:
// oldValue 为 null。
//
// T:System.ArgumentException:
// oldValue 的长度为零。
//
// T:System.ArgumentOutOfRangeException:
// 增大此实例的值将超过 System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Replace(string oldValue, string newValue);
//
// 摘要:
// 将此实例的子字符串中所有指定字符串的匹配项替换为其他指定字符串。
//
// 参数:
// oldValue:
// 要替换的字符串。
//
// newValue:
// 替换 oldValue 的字符串或 null。
//
// startIndex:
// 此实例中子字符串开始的位置。
//
// count:
// 子字符串的长度。
//
// 返回结果:
// 对此实例的引用,其中从 startIndex 到 startIndex+count- 1 的范围内 oldValue 的所有实例被 newValue 替换。
//
// 异常:
// T:System.ArgumentNullException:
// oldValue 为 null。
//
// T:System.ArgumentException:
// oldValue 的长度为零。
//
// T:System.ArgumentOutOfRangeException:
// startIndex 或 count 小于零。- 或 -startIndex 与 count 之和指示一个不在此实例内的字符位置。- 或 -增大此实例的值将超过
// System.Text.StringBuilder.MaxCapacity。
[SecuritySafeCritical]
public StringBuilder Replace(string oldValue, string newValue, int startIndex, int count);
//
// 摘要:
// 将此实例中所有的指定字符替换为其他指定字符。
//
// 参数:
// oldChar:
// 要替换的字符。
//
// newChar:
// 替换 oldChar 的字符。
//
// 返回结果:
// 对此实例的引用,其中 oldChar 被 newChar 替换。
public StringBuilder Replace(char oldChar, char newChar);
//
// 摘要:
// 将此实例的子字符串中所有指定字符的匹配项替换为其他指定字符。
//
// 参数:
// oldChar:
// 要替换的字符。
//
// newChar:
// 替换 oldChar 的字符。
//
// startIndex:
// 此实例中子字符串开始的位置。
//
// count:
// 子字符串的长度。
//
// 返回结果:
// 对此实例的引用,其中从 startIndex 到 startIndex + count -1 范围内的 oldChar 被 newChar 替换。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// startIndex+count 大于此实例值的长度。- 或 -startIndex 或 count 小于零。
[SecuritySafeCritical]
public StringBuilder Replace(char oldChar, char newChar, int startIndex, int count);
//
// 摘要:
// 将此实例中子字符串的值转换为 System.String。
//
// 参数:
// startIndex:
// 此实例内子字符串的起始位置。
//
// length:
// 子字符串的长度。
//
// 返回结果:
// 一个字符串,其值与此实例的指定子字符串相同。
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// startIndex 或 length 小于零。- 或 -startIndex 与 length 的和大于当前实例的长度。
[SecuritySafeCritical]
public string ToString(int startIndex, int length);
//
// 摘要:
// 将此实例的值转换为 System.String。
//
// 返回结果:
// 其值与此实例相同的字符串。
[SecuritySafeCritical]
public override string ToString();
}
}
2.返回顶部 |
3.返回顶部 |
4.返回顶部 |
5.返回顶部 |
6.返回顶部 |
![]() |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
.NETFramework:StringBuilder的更多相关文章
- 教你50招提升ASP.NET性能(二十三):StringBuilder不适用于所有字符串连接的场景;String.Join可能是
(41)StringBuilder is NOT the answer for all string concatenation scenarios; String.Join could be 招数4 ...
- Java常用类:StringBuilder
一.介绍 2 3 4 5 //同样,StringBuilder也是final修饰的不可变,相比String来说,继承了AbstractStringBuilder,StringBuffer也是同样继承了 ...
- .NETFramework:DateTimeOffset
ylbtech-.NETFramework:DateTimeOffset 表示一个时间点,通常相对于协调世界时(UTC)的日期和时间来表示. 1.程序集 mscorlib, Version=4.0.0 ...
- .NETFramework:Random
ylbtech-.NETFramework:Random 1.程序集 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c ...
- .NETFramework:ConfigurationManager
ylbtech-.NETFramework:ConfigurationManager 1.程序集 System.Configuration, Version=4.0.0.0, Culture=neut ...
- .NETFramework:WebClient
ylbtech-.NETFramework:WebClient 1.程序集 System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5 ...
- .NETFramework:Timers
ylbtech-.NETFramework:Timers 1.返回顶部 1. #region 程序集 System, Version=4.0.0.0, Culture=neutral, PublicK ...
- .NETFramework:Stream
ylbtech-.NETFramework:Stream 1.返回顶部 1. #region 程序集 mscorlib, Version=4.0.0.0, Culture=neutral, Publi ...
- .NETFramework:HttpContext
ylbtech-.NETFramework:HttpContext 1.返回顶部 1. #region 程序集 System.Web, Version=4.0.0.0, Culture=neutral ...
随机推荐
- XMLHttpRequest cannot load ''. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' ' is therefore not allowed access.
ajax跨域 禁止访问! 利用Access-Control-Allow-Origin响应头解决跨域请求
- [转]XMPP基本概念--节(stanza)
本文介绍在XMPP通信中最核心的三个XML节(stanza).这些节(stanza)有自己的作用和目标,通过组织不同的节(stanza),就能达到我们各种各样的通信目的. 首先我们来看一段XMPP流. ...
- runsv
runsv(8) manual page http://smarden.org/runit/runsv.8.html Name runsv - starts and monitors a servic ...
- JVM GC调优一则--增大Eden Space提高性能
版权声明:本文为横云断岭原创文章,未经博主同意不得转载.微信公众号:横云断岭的专栏 https://blog.csdn.net/hengyunabc/article/details/24924843 ...
- High Performance Browser Networking
Chapter 1. Primer on Latency and Bandwidth As a result, to improve performance of our applications, ...
- 模型层的Meta选项详解
一 . 模型层的Meta选项详解 Django模型类的Meta是一个内部类,它用于定义一些Django模型类的行为特性.便用方法及参数解释如下 : class Book(models.Model): ...
- 【Leetcode-easy】Remove Element
思路:遍历数组,count保存下一个元素的位置,如果不与该元素相同,那么将该数保存在count位置,并且count++,否则,继续遍历. public int removeElement(int[] ...
- leetcode 890. Possible Bipartition
Given a set of N people (numbered 1, 2, ..., N), we would like to split everyone into two groups of ...
- Android中m、mm、mmm、mma、mmma的区别
m:编译整个安卓系统 makes from the top of the tree mm:编译当前目录下的模块,当前目录下需要有Android.mk这个makefile文件,否则就往上找最近的Andr ...
- 51Nod 1084 矩阵取数问题 V2 —— 最小费用最大流 or 多线程DP
题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1084 1084 矩阵取数问题 V2 基准时间限制:2 秒 空 ...