Convert Char[ ] To Char ? [ ]
-
Hi, is it possible to convert a char array to a nullable char array?
string myString;
char?[] charArray = (char?[])(myString.ToCharArray()); -
Hi, is it possible to convert a char array to a nullable char array?
string myString;
char?[] charArray = (char?[])(myString.ToCharArray());Not directly. Each element has to be cast to a char?. Probably use Linq
char?[] charArray = myString.Cast<char?>().ToArray()
Cheers, Mick ------------------------------------------------ It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
-
Hi, is it possible to convert a char array to a nullable char array?
string myString;
char?[] charArray = (char?[])(myString.ToCharArray());No, Char is just a single letter or number. Char[] is a list of Chars. You can loop the list and concatenate a string or if the list have a fixed size declare a Char for each element and fill when you loop the list.