0
str = "Execution {Virtuosity, fluidity, synchronization and dynamism|Projection, expression, costume, & audience impact}";

temp = str.Split('{');
final = temp[1].Split('|');

as my code snippet i can't deny that its for lazy people :D

can i possible split with 2 char? split with '{' and '|' and remove the last char '}'.

confuse? here's what i want to happen.

from

str = "Execution {Virtuosity, fluidity, synchronization and dynamism|Projection, expression, costume, & audience impact}";

to

final[] = {"Execution","Virtuosity, fluidity, synchronization and dynamism","Projection, expression, costume, & audience impact"};

anyone can help please.

1
  • if input is str = "AA|BB{CC|DD}" what is your expected output? Commented Sep 29, 2014 at 3:10

1 Answer 1

5

Consider using another overload of Split

string str = "Execution {Virtuosity, fluidity, synchronization and"
           + " dynamism|Projection, expression, costume, & audience impact}";
string[] final = str.Split(new char[] { '{', '}', '|' },
                     StringSplitOptions.RemoveEmptyEntries
                 );
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.