Click here to Skip to main content
15,881,859 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,
Can anyone help me for the following
Consider following string
AA,BB,CC,DD

I'm trying to get those values in string array as below
AA
BB
CC
DD


Any idea how to go about it.

Thanks in Advance
Posted

1 solution

Now what exactly does the title of your question have to do with the body of your question? Given that the body of your question holds the most relevant information I dare say you want to split a string in to separate tokens using the comma as a separator. Please have a look into the String.Split[^] method which yields a String array and has several convenient overloads.

Best Regards,
 
Share this answer
 
v3
Comments
Albin Abel 15-Mar-11 9:30am    
String split is all what Op need. My 5
Manfred Rudolf Bihy 15-Mar-11 9:31am    
Thanks!
Albin Abel 15-Mar-11 9:32am    
Title and content mismatching might be due to some misunderstanding as he may thought need to count the position of those commas.
Manfred Rudolf Bihy 15-Mar-11 9:36am    
Or he wanted to count the word occurrences!
fjdiewornncalwe 15-Mar-11 9:34am    
Looks like someone is doing a simple homework assignment or writing a test with access to the internet. :) String.Split is the answer... +5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900