Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more: , +
I have a string ,i will get this data from server under XElement, i have made it into a string and it looks like say
9000384454|130945522842|13098575900|917379563772|919014742532|99484575475
do i need to parse to add these kind of data
i need to add these each number into list box as listbox items whenever i get a pipe symbol, how can i do this , how can i separate them.
any solutions will be appreciated .
Posted
Comments
CHill60 12-Jun-15 9:03am    
look up string.Split()

1 solution

Try this
C#
string input = "9000384454|130945522842|13098575900|917379563772|919014742532|99484575475";
var items = input.Split(new []{'|'}, StringSplitOptions.RemoveEmptyEntries);
listBox1.DataSource = items;
 
Share this answer
 

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