Skip to content

Commit

Permalink
only first char to lower
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvenclovas committed May 9, 2024
1 parent 988655c commit 08f5b0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Source/FikaAmazonAPI/Parameter/ParameterBased.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public virtual List<KeyValuePair<string, string>> getParameters()

var propName = p.Name;

queryParameters.Add(new KeyValuePair<string, string>(propName.ToCamelCase(), output));
queryParameters.Add(new KeyValuePair<string, string>(propName.FirstCharToLower(), output));
}

}
Expand Down
15 changes: 2 additions & 13 deletions Source/FikaAmazonAPI/Utils/StringHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,9 @@ namespace FikaAmazonAPI.Utils
{
public static class StringHelper
{
public static string ToCamelCase(this string str)
public static string FirstCharToLower(this string str)
{
if (string.IsNullOrEmpty(str))
return str;

string[] words = str.Split(new char[] { '_', '-', ' ' }, StringSplitOptions.RemoveEmptyEntries);
string camelCase = words[0].ToLower();

for (int i = 1; i < words.Length; i++)
{
camelCase += words[i].Substring(0, 1).ToUpper() + words[i].Substring(1).ToLower();
}

return camelCase;
return Char.ToLower(str[0]) + str.Substring(1);
}
}
}

0 comments on commit 08f5b0f

Please sign in to comment.