Mihir Mihir - 3 years ago 119
C# Question

How to convert string to string[]?

How to convert

type to
type in C#?

Answer Source

string[] is an array (vector) of strings string is just a string (a list/array of characters)

Depending on how you want to convert this, the canonical answer could be:

string[] -> string

return String.Join(" ", myStringArray);

string -> string[]

return new []{ myString };
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download