.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 ...
随机推荐
- 解决Oracle用户被锁定的方法
解决Oracle用户被锁定的方法 1,cmd控制台: 使用sqlplus 命令:sqlplus sys/密码@ip/orcl as sysdba; 2,先设置具体时间格式,以便查看具体时间 SQL&g ...
- Android中处理崩溃异常和记录日志(转)
现在安装Android系统的手机版本和设备千差万别,在模拟器上运行良好的程序安装到某款手机上说不定就出现崩溃的现象,开发者个人不可能购买所有设备逐个调试,所以在程序发布出去之后,如果出现了崩溃现象,开 ...
- 前端编程提高之旅(三)----浏览器兼容之IE6
在爱奇艺实习期间,乐帝主要负责移动端活动页面的制作,因为移动浏览器是随着智能手机兴起的,这就决定了移动端不会重蹈浏览器兼容问题的覆辙.一開始就比較好的支持web标准,而纵观整个互联网行业,移动web开 ...
- ASP.NET动态网站制作(11)-- JQ(3)
前言:这节课主要是讲CSS作业,然后继续讲jQuery. 内容: 1.css作业讲解. 2.jq设置元素样式: (1)添加.删除css类别:$("div").addClass(& ...
- Android异步处理二:使用AsyncTask异步更新UI界面
在<Android异步处理一:使用Thread+Handler实现非UI线程更新UI界面>中,我们使用Thread+Handler的方式实现了异步更新UI界面,这一篇中,我们介绍一种更为简 ...
- Unity3D 动态地创建识别图
前面介绍了EasyAR的单图识别,它是提前在Unity设置好图片路径的,那么如果我们的图片是存储在服务器上的,那么我们肯定不能直接把服务的图片地址填上去了.这个时候我们可以动态地创建识别图.步骤如下: ...
- Jaccard Similarity and Shingling
https://www.cs.utah.edu/~jeffp/teaching/cs5955/L4-Jaccard+Shingle.pdf https://www.cs.utah.edu/~jeffp ...
- UVA 11077 - Find the Permutations(递推)
UVA 11077 - Find the Permutations option=com_onlinejudge&Itemid=8&page=show_problem&cate ...
- Hadoop基础学习(一)分析、编写并执行WordCount词频统计程序
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/jiq408694711/article/details/34181439 前面已经在我的Ubuntu ...
- Python爬虫一些操作headers与cookies的便捷工具
本篇文章主要是爬虫中常用的便捷处理方法整理,转载请注明出处 #!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2018-08-14 13: ...
