c# - Split a word into an array of unique letters -
how split string array of unique characters using c#?
i know code below splits string array, won't pick out unique characters:
string s = "robot"; char[] chararray = s.tochararray(); (int = 0; < chararray.length; i++) { console.writeline(chararray[i]); }
this done easy linq:
char[] chararray = s.tochararray().distinct().toarray()
Comments
Post a Comment