string to array
-
hi friends how to convert string to arrays for example "hello world" is given string how to change it in single dimensional array
the quieter u become more u hear
-
hi friends how to convert string to arrays for example "hello world" is given string how to change it in single dimensional array
the quieter u become more u hear
-
hi friends how to convert string to arrays for example "hello world" is given string how to change it in single dimensional array
the quieter u become more u hear
string s = "hello world";
char[] c = s.ToCharArray();gives an array of char. If you need an array of strings you can convert from that.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) -
string s = "hello world";
char[] c = s.ToCharArray();gives an array of char. If you need an array of strings you can convert from that.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)thanks
the quieter u become more u hear
-
hi friends how to convert string to arrays for example "hello world" is given string how to change it in single dimensional array
the quieter u become more u hear
Hi, if you don't actually need the array and just want to enumerate the characters in a string (without changing them!) you can do:
string myString="Some string";
foreach (char myChar in myString) {
Console.WriteLine("myChar="+myChar);
}PS: please read my signature, I changed it after reading your recent posts. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Friday, June 10, 2011 12:03 PM
-
Hi, if you don't actually need the array and just want to enumerate the characters in a string (without changing them!) you can do:
string myString="Some string";
foreach (char myChar in myString) {
Console.WriteLine("myChar="+myChar);
}PS: please read my signature, I changed it after reading your recent posts. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Friday, June 10, 2011 12:03 PM