json转string示例_C.示例中的String.Copy()方法
生活随笔
收集整理的這篇文章主要介紹了
json转string示例_C.示例中的String.Copy()方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
json轉string示例
C#String.Copy()方法 (C# String.Copy() Method)
String.Copy() method is used to copy a string to new string object, it returns a new instance of String with the same value as given string.
String.Copy()方法用于將字符串復制到新的字符串對象,它返回具有與給定字符串相同值的String的新實例。
Syntax:
句法:
public static string Copy (string str);Parameter: string – whose value to be copied
參數: string-要復制其值的字符串
Return value: string - returns a copy of the given strong.
返回值: 字符串 -返回給定強度的副本。
Example:
例:
Input:string str1 = "IncludeHelp";creating new string using String.Copy() method:string str2 = String.Copy(str1);Output:str1: IncludeHelpstr2: IncludeHelpC#使用String.Copy()方法復制字符串的示例 (C# Example to copy a string using String.Copy() method)
using System; using System.Text;namespace Test {class Program{static void Main(string[] args){string str1 = "IncludeHelp";//creating new string using String.Copy() methodstring str2 = String.Copy(str1);//printing stringsConsole.WriteLine("str1: " + str1);Console.WriteLine("str2: " + str2);//hit ENTER to exitConsole.ReadLine();}} }Output
輸出量
str1: IncludeHelp str2: IncludeHelpReference: String.Copy(String) Method
參考: String.Copy(String)方法
翻譯自: https://www.includehelp.com/dot-net/string-copy-method-with-example-in-c-sharp.aspx
json轉string示例
總結
以上是生活随笔為你收集整理的json转string示例_C.示例中的String.Copy()方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python函数示例_PHP close
- 下一篇: node oauth2验证_如何设置和使