Skip to content

C# library to split a string into its containing logical words

License

Notifications You must be signed in to change notification settings

ilia-cy/WordSplitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordSplitter

C# library to split a string into its containing words.

Examples

Hyphen and underscore as delimiters

"first-second-third".SplitWords();
["first", "second", "third"]

"first_second_third".SplitWords();
["first", "second", "third"]

CamelCase

"CamelCase".SplitWords();
["Camel", "Case"]

UpperCase

"TheBIGHouse".SplitWords();
["The", "Big", "House"]

Configuration

  • ShouldReturnResultsInLowerCase
const string input = "ABC_DEF";
var configuration = new WordSplitterConfiguration {
    ShouldReturnResultsInLowerCase = true
};

input.SplitWords(configuration);
["abc", "def"]
  • Custom Delimiters
var configuration = new WordSplitterConfiguration {
    Delimiters = new List<char> {'W'}
};

const string inputWithNewDelimiters = "ABCWDEF";
["ABC", "DEF"]

Default Configuration

  • ShouldReturnResultsInLowerCase: false
  • Delimiters: ['-', '_', '.', ' ', ';']

About

C# library to split a string into its containing logical words

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages