string str1="abc";
string str2=str1;
Console.WriteLine(str1);
Console.WriteLine(str2);
str2="cba";
Console.WriteLine(str1);
Console.WriteLine(str2);System.String继承于System.Object,使用赋值运算符时,.net framework到底做了什么?求解释.
解决方案 »
- 对GridView实现编辑删除时如何获取所要编辑或删除的行的索引?
- 图形图像问题?100分求思路!
- 急!!!在线等.如何动态修改xml节点里的值?
- 一个新手问题 请各位老师帮忙!
- .Net中三层构架是怎么回事
- iis7 下 Global.asax 中的 Application["GroupType"] 為什麽不能使用 報 System.Web.HttpException: 请求在此上下文中不可用
- winfom 下combobox怎样设成只读的?
- Graphics怎样在WEB页中创建绘图对象啊?
- 高手進!!如何在不同的Assembly之間訪問類的靜態方法????
- 寻cell的一个自定义报表示例
- 请教C# Dictionary存储千万数据内存溢出问题
- -----C# 导出excel 加超链接 怎么实现啊---------
看看MSDNhttp://msdn.microsoft.com/zh-cn/library/system.string(v=VS.80).aspx
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Class: String
**
**
** Purpose: Contains headers for the String class. Actual implementations
** are in String.cpp
**
**
===========================================================*/
namespace System {
using System.Text;
using System;
using System.Runtime.ConstrainedExecution;
using System.Globalization;
using System.Threading;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using va_list = System.ArgIterator;
//
// For Information on these methods, please see COMString.cpp
//
// The String class represents a static string of characters. Many of
// the String methods perform some type of transformation on the current
// instance and return the result as a new String. All comparison methods are
// implemented as a part of String. As with arrays, character positions
// (indices) are zero-based.
//
// When passign a null string into a constructor in VJ and VC, the null should be
// explicitly type cast to a String.
// For Example:
// String s = new String((String)null);
// Text.Out.WriteLine(s);
//
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable] public sealed class String : IComparable, ICloneable, IConvertible, IEnumerable
#if GENERICS_WORK
, IComparable<String>, IEnumerable<char>, IEquatable<String>
#endif
{ //
//
[NonSerialized]private int m_arrayLength;
[NonSerialized]private int m_stringLength;
[NonSerialized]private char m_firstChar; //private static readonly char FmtMsgMarkerChar='%';
//private static readonly char FmtMsgFmtCodeChar='!';
//These are defined in Com99/src/vm/COMStringCommon.h and must be kept in sync.
private const int TrimHead = 0;
private const int TrimTail = 1;
private const int TrimBoth = 2;
// The Empty constant holds the empty string value.
//We need to call the String constructor so that the compiler doesn't this as a literal.
//Marking this as a literal would mean that it doesn't show up as a field which we can access
//from native.
public static readonly String Empty = "";
...
}// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.