mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-03 20:04:08 +08:00
Update ToUnderLine
This commit is contained in:
@@ -17,9 +17,16 @@ namespace SqlSugar
|
||||
{
|
||||
public class UtilMethods
|
||||
{
|
||||
public static string ToUnderLine(string str)
|
||||
public static string ToUnderLine(string str, bool isToUpper = false)
|
||||
{
|
||||
return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "_" + x.ToString() : x.ToString())).ToLower();
|
||||
if (isToUpper)
|
||||
{
|
||||
return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "_" + x.ToString() : x.ToString())).ToUpper();
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "_" + x.ToString() : x.ToString())).ToLower();
|
||||
}
|
||||
}
|
||||
|
||||
internal static bool IsJsonMember(Expression expression, SqlSugarProvider context)
|
||||
|
||||
Reference in New Issue
Block a user