Link to home
Start Free TrialLog in
Avatar of itinfo7
itinfo7

asked on

Loop thorugh string in .net

I have
string like this

string mystring = This is the %EventName% and place is %ShelterName%

 I want to seperate the %EventName% ,%shelterName% as seperate string.

I am not sure how I can loop thorugh string and get the position of %.Please Help me out with this.
Avatar of jackDOTisenberg
jackDOTisenberg
Flag of United States of America image

Can you please provide a sample of the string that you need to parse? Depending on the structure of the string, you will be able to parse the string and pull out the different variables that you want.

If you post a sample, I may be able to write the parse statement for you.
Avatar of itinfo7
itinfo7

ASKER

string parsestring  = VCA is the %Animal% Hospital and It's located %texas%
Avatar of itinfo7

ASKER

Actually string is changeable but it would follow same format I am giving you.
This requires a little more code than I can do over my phone, but the following example should give you everything you need to get the variables you want.

Extract a value between two spaces in a string
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial