By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,925 Members | 727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,925 IT Pros & Developers. It's quick & easy.

+how to C# split string (each char) into array

P: 14
Hello,
Can anyone help me?

I am trying to split a string in c# but i don't have a separator.

for example split the string "hello"
into array [0]=h [1]=e [2]=l [3]=l [4]=o
Oct 8 '07 #1
Share this Question
Share on Google+
2 Replies


Plater
Expert 5K+
P: 7,872
Try this:
Expand|Select|Wrap|Line Numbers
  1. string mys="hello";
  2. char[] thechars=mys.ToCharArray();
  3.  
Oct 8 '07 #2

P: 14
Try this:
Expand|Select|Wrap|Line Numbers
  1. string mys="hello";
  2. char[] thechars=mys.ToCharArray();
  3.  
Thanks!!!! it works.
cheers.
Oct 8 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.