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.

適用於

另請參閱