Click here to Skip to main content
15,891,763 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
progress billings made to meet project requirements will be invoiced when applicable and subject to the same terms. In the event it shall become necessary for {{businessName}} to enforce any of the provisions of this agreement

i need
C#
string v1="progress billings made to meet project requirements will be invoiced when applicable and subject to the same terms. In the event it shall become necessary for" ;
string v2="{{businessName}}";
string v3="to enforce any of the provisions of this agreement";

please how to do?
Posted
Updated 8-Oct-12 4:01am
v2

C#
string words = "This is a list of words, with: a bit of punctuation" +
                      "\tand a tab character.";

       string [] split = words.Split(new Char [] {' ', ',', '.', ':', '\t' });

       foreach (string s in split) {

           if (s.Trim() != "")
               Console.WriteLine(s);
       }
 
Share this answer
 
Comments
Abhi KA 8-Oct-12 10:08am    
split by words how?
Abhi KA 8-Oct-12 10:08am    
delimiter i know
There are a lot of ways to do this - I would probably use a regex:
C#
public static Regex regex = new Regex(
      "(.*?)\\s({{.*?}})\\s(.*)",
    RegexOptions.IgnoreCase
    | RegexOptions.Multiline
    | RegexOptions.Singleline
    | RegexOptions.CultureInvariant
    | RegexOptions.Compiled
    );
This woudl give you three groups, broken as you wanted.
 
Share this answer
 

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