Skip to content

Commit

Permalink
cache CulturedStringTransformers (#1441)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Feb 23, 2024
1 parent 3e9d5df commit 086ed2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Humanizer/Transformer/To.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ public static string Transform(this string input, CultureInfo culture, params IC
/// <example>
/// "INvalid caSEs arE corrected" -> "Invalid Cases Are Corrected"
/// </example>
public static ICulturedStringTransformer TitleCase => new ToTitleCase();
public static ICulturedStringTransformer TitleCase { get; } = new ToTitleCase();

/// <summary>
/// Changes the string to lower case
/// </summary>
/// <example>
/// "Sentence casing" -> "sentence casing"
/// </example>
public static ICulturedStringTransformer LowerCase => new ToLowerCase();
public static ICulturedStringTransformer LowerCase { get; } = new ToLowerCase();

/// <summary>
/// Changes the string to upper case
/// </summary>
/// <example>
/// "lower case statement" -> "LOWER CASE STATEMENT"
/// </example>
public static ICulturedStringTransformer UpperCase => new ToUpperCase();
public static ICulturedStringTransformer UpperCase { get; } = new ToUpperCase();

/// <summary>
/// Changes the string to sentence case
/// </summary>
/// <example>
/// "lower case statement" -> "Lower case statement"
/// </example>
public static ICulturedStringTransformer SentenceCase => new ToSentenceCase();
public static ICulturedStringTransformer SentenceCase { get; } = new ToSentenceCase();
}
}

0 comments on commit 086ed2c

Please sign in to comment.