- Home /
disperse string by letter
I have a string var asd = "qwert"
How can I make it "q" "w" "e" "r" "t" by splitting.
I check out string.split method but I guess it's not useful for this problem.
You know you can iterate over a string using the [] operator, right?
Sure. I made the array for example. $$anonymous$$y problem is how can I split the string
A string is already basically an array of chars, so you don't need to do that. Also you don't want to use Array anyway, it's slow and obsolete; use built-in arrays or List.
I edited the question, that's not my real question, my question is how can I split the string like that.
Answer by Eric5h5 · Nov 03, 2012 at 09:32 PM
No need for splitting:
var aString = "qwert";
var aCharArray = aString.ToCharArray();
Although a string is essentially already an array of chars, but that will convert it to a "real" array.
Your answer
Follow this Question
Related Questions
Extract number from string? 3 Answers
how can i split a word to individual letters..?? 2 Answers
StringSplitOptions.RemoveEmptyEntries - Unknown identifier 2 Answers
issues splitting strings 1 Answer
How to split a string into array? 2 Answers