Click here to Skip to main content
15,891,855 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Please help me how to split the

list<string> item=new list<string>();
item.Add("sample45.00145.00");
item.Add("water45.00145.00");
My output should be like this:

sample (some space) 45.00 (some space) 1 (some space) 45.00
water (some space) 45.00 (some space) 1 (some space) 50.00
Posted
Updated 18-Mar-13 0:43am
v2
Comments
Matt T Heffron 18-Mar-13 14:20pm    
There isn't enough information in your question to give any useful suggestions.
You haven't given a definition/description of how you know where you need/want to split the input strings.
(I'm assuming that the quoted strings you've shown are merely representative of the actual data acquired from some other source.)
(Why is the data in this poor format to start with?)

1 solution

C#
item.Add("sample   45.00    145.00");
 item.Add("water   45.00   145.00");
 
Share this answer
 
Comments
Matt T Heffron 18-Mar-13 14:16pm    
Obvious and doesn't event match the stated question.
frostcox 18-Mar-13 15:13pm    
Ha what question:)

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