Skip to content

Commit

Permalink
Merge pull request #1492 from nesc58/fix-culture
Browse files Browse the repository at this point in the history
Fix culture
  • Loading branch information
alexeyzimarev authored Sep 4, 2020
2 parents ccb68a7 + a5555f9 commit 25debfa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/RestSharp/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,15 @@ string CaseWord(string word)
/// <param name="culture"></param>
/// <returns>String</returns>
public static string ToCamelCase(this string lowercaseAndUnderscoredWord, CultureInfo culture)
=> MakeInitialLowerCase(ToPascalCase(lowercaseAndUnderscoredWord, culture));
=> MakeInitialLowerCase(ToPascalCase(lowercaseAndUnderscoredWord, culture), culture);

/// <summary>
/// Convert the first letter of a string to lower case
/// </summary>
/// <param name="word">String to convert</param>
/// <param name="culture"></param>
/// <returns>string</returns>
public static string MakeInitialLowerCase(this string word) => string.Concat(word.Substring(0, 1).ToLower(), word.Substring(1));
public static string MakeInitialLowerCase(this string word, CultureInfo culture) => string.Concat(word.Substring(0, 1).ToLower(culture), word.Substring(1));

/// <summary>
/// Add underscores to a pascal-cased string
Expand Down

0 comments on commit 25debfa

Please sign in to comment.