1 Replies - 322 Views - Last Post: 27 April 2014 - 02:33 PM Rate Topic: -----

#1 kimi86  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-April 14

parsing a string

Posted 27 April 2014 - 02:29 PM

Hi All,
I have a simple code to wirte but I cant figure out because I am totally new to c# coding
I need to parse a string and add the substrings into a list<strings>

For example if I have "apple banana$USA$How are you$I am OK"
I want to get a list of strings with each Item as below
apple banana
USA
How are you
I am OK


Could you please help??

Is This A Good Question/Topic? 0
  • +

Replies To: parsing a string

#2 sepp2k  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2089
  • View blog
  • Posts: 3,181
  • Joined: 21-June 11

Re: parsing a string

Posted 27 April 2014 - 02:33 PM

Take a look at the String.Split method. That will return an array. If you need it to be a list, you can call the list constructor with an array as its argument.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1