Method | Description | |
---|---|---|
Abbreviate ( this s, int maxWidth ) : string |
Abbreviates a string using ellipses. This will turn "Now is the time for all good men" into "Now is the time for..." Specifically:
null input string returns null . Abbreviate(null, 4) = null Abbreviate("", 4) = "" Abbreviate("abcdefg", 6) = "abc..." Abbreviate("abcdefg", 7) = "abcdefg" Abbreviate("abcdefg", 8) = "abcdefg" Abbreviate("abcdefg", 4) = "a..." Abbreviate("abcdefg", 3) = IllegalArgumentException |
|
Brutalize ( this s ) : string |
Anti-Humanize. If you are curious where the name comes from, see Article for details. |
|
Capitalize ( this s ) : string |
Capitalizes all the whitespace separated words in a string. A |
|
Humanize ( this s ) : string |
Capitalizes the first word and turns underscores into spaces. A |
|
Pluralize ( this s ) : string |
Returns the plural form of the word in the string. A |
|
Pluralize ( this s, int count ) : string | ||
Singularize ( this s ) : string |
The reverse of Pluralize(string), returns the singular form of a word in a string. A |
Method | Description | |
---|---|---|
AddIrregularRule ( string singular, string plural ) : void | ||
AddPluralRule ( string rule, string replacement ) : void |
Adds the plural rule.
|
|
AddSingularRule ( string rule, string replacement ) : void | ||
AddUnknownCountRule ( string word ) : void |
Adds the unknown count rule.
|
|
ApplyRules ( IList |
Applies the rules.
|
|
Inflector ( ) : System |
Initializes the Inflector class.
|
public static Abbreviate ( this s, int maxWidth ) : string | ||
s | this | |
maxWidth | int | |
return | string |
public static Pluralize ( this s, int count ) : string | ||
s | this | |
count | int | |
return | string |
public static Singularize ( this s ) : string | ||
s | this | |
return | string |