Forged ships a set of string-specific extension methods that slot directly into anyDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/atulin/forged/llms.txt
Use this file to discover all available pages before exploring further.
Generator<string> pipeline. Each method wraps the upstream generator in a dedicated transformer class — UppercaseGenerator, LowercaseGenerator, TitleCaseGenerator, CapitalizeGenerator, and SentencifyGenerator — and returns a new Generator<string>, so you can continue chaining further modifiers after them.
These extensions are defined using the C# 14
extension member syntax inside StringGeneratorExtensions. This means your project must target .NET 10 or later and use the C# 14 language version. Earlier toolchains will not compile them.Case conversion
.ToUpper()
Converts every generated string to uppercase using the invariant culture (string.ToUpperInvariant()).
Returns Generator<string>
.ToLower()
Converts every generated string to lowercase using the invariant culture (string.ToLowerInvariant()).
Returns Generator<string>
.ToTitleCase(CultureInfo? cultureInfo = null)
Converts every generated string to title case using TextInfo.ToTitleCase from the supplied (or forge-default) culture.
The culture whose
TextInfo is used for the conversion. When null, falls back to the Forge instance’s configured locale.Generator<string>
Capitalization
.Capitalize(CultureInfo? cultureInfo = null)
Uppercases only the first character of the generated string, leaving all remaining characters untouched. This is distinct from .ToTitleCase(), which uppercases the first letter of every word.
The culture to use when uppercasing the first character. When
null, falls back to the Forge instance’s configured locale.Generator<string>
Sentence formatting
.Sentencify(int sentenceLength, CultureInfo? cultureInfo = null)
Takes a generated string (treated as a sequence of space-separated words) and formats it as one or more sentences: the first word of each sentence is capitalized and sentences end with a period. Each sentence is exactly sentenceLength words long.
The fixed number of words per sentence.
The culture to use for first-letter capitalization. Falls back to the
Forge locale when null.Generator<string>
.Sentencify(int minSentenceLength, int maxSentenceLength, CultureInfo? cultureInfo = null)
Same as the single-length overload, but the number of words per sentence is chosen randomly within the inclusive [minSentenceLength, maxSentenceLength] range on each generation call, giving more natural-sounding output.
The minimum number of words per sentence (inclusive).
The maximum number of words per sentence (inclusive).
The culture to use for first-letter capitalization. Falls back to the
Forge locale when null.Generator<string>
Chaining example
All string extension methods returnGenerator<string>, so they can be freely chained with each other and with any other Generator<T> modifier: