Find the number of string occurrences in another string(madskristensen.dk)

submitted by madskristensenmadskristensen(8565) 5 years, 8 months ago

In C# 2.0 Microsoft introduces some new methods on the String class, one of them being Contains. The Contains method checks if a string in contained within another string in a case-sensitive way. It is very easy to use and a good addition to the String class. However, often you don’t want a case-sensitive search or you want to know how many times a particular string is contained within another. Because the String class doesn’t provide us with such methods, we have to create our own. Here are three methods – two overloaded – that does just that.

add a comment |category: |Views: 1

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story