String.Clone String.Clone String.Clone String.Clone Method

定義

傳回對 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. Copy使用或CopyTo方法來建立與這個實例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.

適用於

另請參閱