-
August 3rd, 2012, 07:54 AM
#1
How to split a string without using separator
Hello
I want to split string like "MASOUD" and put it in array(M in first index,A in second one...)but I dont wanna use separators.
would you please help me??
-
August 3rd, 2012, 08:38 AM
#2
Re: How to split a string without using separator
Is this what you want?
Code:
string str = "MASOUD";
char[] arr = str.ToCharArray();
-
August 3rd, 2012, 08:49 AM
#3
Re: How to split a string without using separator
This is the error:
A field initializer cannot reference the non-static field, method, or property 'Window1.Form1.str'
-
August 3rd, 2012, 10:08 AM
#4
Re: How to split a string without using separator
Well that's another issue. It's just as the compiler say, since 'Window1.Form1.str' isn't static it doesn't exist where you try to use it.
If you don't solve it yourself you have to post your code but don't forget to use code tags [code]Paste your code here[/code]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|