String.Clone 方法

定义

返回对此 String实例的引用。Returns a reference to this instance of String.

public:
 virtual System::Object ^ Clone();
public object Clone ();
abstract member Clone : unit -> obj
override this.Clone : unit -> obj
Public Function Clone () As Object

返回

String 实例。This instance of String.

实现

注解

返回值不是此实例的独立副本;它只是相同数据的另一个视图。The return value is not an independent copy of this instance; it is simply another view of the same data. 使用 CopyCopyTo 方法来创建一个与此实例具有相同值的单独 String 对象。Use the Copy or CopyTo method to create a separate String object with the same value as this instance.

由于 Clone 方法只是返回现有的字符串实例,因此很少需要直接调用它。Because the Clone method simply returns the existing string instance, there is little reason to call it directly.

适用于

另请参阅