Click here to Skip to main content
12,070,764 members (65,403 online)
Rate this:
 
Please Sign up or sign in to vote.
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
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 8-Oct-12 4:56am
Edited 8-Oct-12 5:01am
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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);
       }
  Permalink  
Comments
Abhiram KA 8-Oct-12 10:08am
   
split by words how?
Abhiram KA 8-Oct-12 10:08am
   
delimiter i know
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

There are a lot of ways to do this - I would probably use a regex:
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.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160208.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100