diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs b/Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs index 3e8f39eba..2073c15bb 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs @@ -288,14 +288,14 @@ namespace SqlSugar { var parameterNameA = mode.Args[0].MemberName; var parameterNameB = mode.Args[1].MemberName; - return $" RTRIM(REPLACE({parameterNameA}, {parameterNameB}, '')) "; + return $" CASE WHEN SUBSTR({parameterNameA}, -1) = {parameterNameB} THEN SUBSTR({parameterNameA}, 1, LENGTH({parameterNameA}) - 1) ELSE {parameterNameA} END "; } public override string TrimStart(MethodCallExpressionModel mode) { var parameterNameA = mode.Args[0].MemberName; var parameterNameB = mode.Args[1].MemberName; - return $" LTRIM(REPLACE({parameterNameA}, {parameterNameB}, '')) "; + return $" CASE WHEN SUBSTR({parameterNameA}, 1, 1) ={parameterNameB} THEN SUBSTR({parameterNameA}, 2) ELSE {parameterNameA} END "; } } }