Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert string to string[]? [closed]

Tags:

c#

How to convert string type to string[] type in C#?

like image 569
Mihir Avatar asked Jun 18 '12 11:06

Mihir


People also ask

Can we convert string [] to string?

So how to convert String array to String in java. We can use Arrays. toString method that invoke the toString() method on individual elements and use StringBuilder to create String. We can also create our own method to convert String array to String if we have some specific format requirements.

How do you convert a string to a string in flutter?

In Flutter and Dart, you can turn a given string into a list (with string elements) by using the split() method. To convert a list of strings to a string, you can use the join() method.


1 Answers

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 }; 
like image 154
Random Dev Avatar answered Sep 27 '22 18:09

Random Dev