Hi Feng,
You could find the number of occurences of any string in the EditControl using the following code :
Regex r = new Regex(searchText, RegexOptions.IgnoreCase);
MatchCollection ma = r.Matches(this.editControl1.Text);
return ma.Count;
I have attached a
test sample here that illustrates the same. Please refer to it and let me know if this meets your requirements.
We have also considered adding a GetInstanceCount method to the EditControl that returns the number of occurences of the specified string. We will try our very best to implement this feature request and you could track the progress of the same at this link below :
Feature Request #694 - Support for GetInstanceCount method in the EditControl
Thanks for your interest in Essential Edit.
Regards,
Guru Patwal
Syncfusion, Inc.