Click here to Skip to main content
15,914,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have string as follows i want to spilt it into an 2D array
where (,)is a row Separator & (;) as a Column separator

,12;priya;abc;HDFC,13;Nutan;def;ICICI,14;Nikita;ghi;SBI,


out put as 2D Array

12 Priya abc HDFC
13 Nutan def ICICI
14 Nikita ghi SBI
Posted
Comments
[no name] 21-Aug-13 5:24am    
Okay so go ahead and do that.
BulletVictim 21-Aug-13 5:28am    
Take a look here
http://www.c-sharpcorner.com/Forums/Thread/195201/convert-string-to-x-dimensional-array.aspx
or here
http://www.codeproject.com/Questions/472861/Convertplusstringplustoplus2plusdimensionalplusarr
Anurag Sinha V 21-Aug-13 5:56am    
Use Split method...

1 solution

Use string.Split to break it into rows:
C#
string[] rows = myString.Split(',');
Then loop through each row and use Split again, this time with ';', to split it into columns.

Since this sounds a lot like homework, I'll leave the exact details to you...:laugh:
 
Share this answer
 
Comments
ridoy 21-Aug-13 5:37am    
right to the point,+5
priyankavm 22-Aug-13 7:36am    
Thank u..
OriginalGriff 22-Aug-13 8:25am    
You're welcome!

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