Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ExtensionMethods
- {
- public static class MyExtensions
- {
- public static int WordCount(this String str)
- {
- return str.Split(new char[] { ' ', '.', '?' },
- StringSplitOptions.RemoveEmptyEntries).Length;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement