C# String Copy() Method
You are Here:
C# String Copy()
The Copy()
method creates a new instance of String with the same content as a specified string.
Example
C# Compiler
using System;
namespace myApp
{
class Program
{
static void Main(string[] args)
{
string s1 = "John doe";
string s2 = string.Copy(s1);
Console.Write("s2 = {0}", s2);
}
}
}
Output
s2 = John doe
Syntax
public static string.Copy(s1)
Parameter Values
Value | Type | Explanation |
---|---|---|
s1 | Required | Specifies the string to be copied. |
Return Value
Value | Explanation |
---|---|
String | Returns a new String with the same content as a specified String. |
Reminder
Hi Developers, we almost covered 90% of String functions and Interview Question on C# with examples for quick and easy learning.
We are working to cover every Single Concept in C#.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.