Get the App
SLTechnology News&Howtos  ›  Development  › 

C # how to connect a string

Shulou Source: shulou.com Published: 2022-06-01 02:01:25 09月21日 Update

This article mainly introduces "how to connect strings in C #". In daily operation, I believe many people have doubts about how to connect strings in C #. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the question of "how to connect strings in C #"! Next, please follow the editor to study!

Example

Using System

Namespace StringApplication

{

Class StringProg

{

Static void Main (string [] args)

{

String [] starray = new string [] {"Down the way nights are dark"

"And the sun shines daily on the mountain top"

"I took a trip on a sailing ship"

"And when I reached Jamaica"

"I made a stop"}

String str = String.Join ("\ n", starray)

Console.WriteLine (str)

Console.ReadKey ()

}

}

}

When the above code is compiled and executed, it produces the following results:

Down the way nights are darkAnd the sun shines daily on the mountain topI took a trip on a sailing shipAnd when I reached JamaicaI made a stop at this point, on the "C # how to connect strings" study is over, I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Characters strings caching learning more help practical next code examples articles methods theories knowledge articles results websites materials follow questions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Redmi Linux Xiaomi OPPO Reno