@@ -730,22 +730,22 @@ public override void ToString(StringBuilder stringBuilder, bool addBrackets)
730730 }
731731 }
732732
733- internal class Function_STARTSWITH : Function_N
733+ internal class Function_STARTSWITH : Function_3
734734 {
735- public Function_STARTSWITH ( FunctionBase [ ] funcs ) : base ( funcs )
735+ public Function_STARTSWITH ( FunctionBase func1 , FunctionBase func2 , FunctionBase func3 ) : base ( func1 , func2 , func3 )
736736 {
737737 }
738738
739739 public override Operand Calculate ( AlgorithmEngine work )
740740 {
741- var args1 = funcs [ 0 ] . Calculate ( work ) ; if ( args1 . Type != OperandType . TEXT ) { args1 = args1 . ToText ( "Function '{0}' parameter {1} is error!" , "StartsWith" , 1 ) ; if ( args1 . IsError ) { return args1 ; } }
742- var args2 = funcs [ 1 ] . Calculate ( work ) ; if ( args2 . Type != OperandType . TEXT ) { args2 = args2 . ToText ( "Function '{0}' parameter {1} is error!" , "StartsWith" , 2 ) ; if ( args2 . IsError ) { return args2 ; } }
741+ var args1 = func1 . Calculate ( work ) ; if ( args1 . Type != OperandType . TEXT ) { args1 = args1 . ToText ( "Function '{0}' parameter {1} is error!" , "StartsWith" , 1 ) ; if ( args1 . IsError ) { return args1 ; } }
742+ var args2 = func2 . Calculate ( work ) ; if ( args2 . Type != OperandType . TEXT ) { args2 = args2 . ToText ( "Function '{0}' parameter {1} is error!" , "StartsWith" , 2 ) ; if ( args2 . IsError ) { return args2 ; } }
743743
744744 var text = args1 . TextValue ;
745- if ( funcs . Length == 2 ) {
745+ if ( func3 == null ) {
746746 return Operand . Create ( text . AsSpan ( ) . StartsWith ( args2 . TextValue . AsSpan ( ) ) ) ;
747747 }
748- var args3 = funcs [ 2 ] . Calculate ( work ) ; if ( args3 . Type != OperandType . BOOLEAN ) { args3 = args3 . ToBoolean ( "Function '{0}' parameter {1} is error!" , "StartsWith" , 3 ) ; if ( args3 . IsError ) { return args3 ; } }
748+ var args3 = func3 . Calculate ( work ) ; if ( args3 . Type != OperandType . BOOLEAN ) { args3 = args3 . ToBoolean ( "Function '{0}' parameter {1} is error!" , "StartsWith" , 3 ) ; if ( args3 . IsError ) { return args3 ; } }
749749 return Operand . Create ( text . AsSpan ( ) . StartsWith ( args2 . TextValue . AsSpan ( ) , args3 . BooleanValue ? StringComparison . OrdinalIgnoreCase : StringComparison . Ordinal ) ) ;
750750 }
751751 public override void ToString ( StringBuilder stringBuilder , bool addBrackets )
@@ -754,21 +754,21 @@ public override void ToString(StringBuilder stringBuilder, bool addBrackets)
754754 }
755755 }
756756
757- internal class Function_ENDSWITH : Function_N
757+ internal class Function_ENDSWITH : Function_3
758758 {
759- public Function_ENDSWITH ( FunctionBase [ ] funcs ) : base ( funcs )
759+ public Function_ENDSWITH ( FunctionBase func1 , FunctionBase func2 , FunctionBase func3 ) : base ( func1 , func2 , func3 )
760760 {
761761 }
762762
763763 public override Operand Calculate ( AlgorithmEngine work )
764764 {
765- var args1 = funcs [ 0 ] . Calculate ( work ) ; if ( args1 . Type != OperandType . TEXT ) { args1 = args1 . ToText ( "Function '{0}' parameter {1} is error!" , "EndsWith" , 1 ) ; if ( args1 . IsError ) { return args1 ; } }
766- var args2 = funcs [ 1 ] . Calculate ( work ) ; if ( args2 . Type != OperandType . TEXT ) { args2 = args2 . ToText ( "Function '{0}' parameter {1} is error!" , "EndsWith" , 2 ) ; if ( args2 . IsError ) { return args2 ; } }
765+ var args1 = func1 . Calculate ( work ) ; if ( args1 . Type != OperandType . TEXT ) { args1 = args1 . ToText ( "Function '{0}' parameter {1} is error!" , "EndsWith" , 1 ) ; if ( args1 . IsError ) { return args1 ; } }
766+ var args2 = func2 . Calculate ( work ) ; if ( args2 . Type != OperandType . TEXT ) { args2 = args2 . ToText ( "Function '{0}' parameter {1} is error!" , "EndsWith" , 2 ) ; if ( args2 . IsError ) { return args2 ; } }
767767 var text = args1 . TextValue ;
768- if ( funcs . Length == 2 ) {
768+ if ( func3 == null ) {
769769 return Operand . Create ( text . AsSpan ( ) . EndsWith ( args2 . TextValue . AsSpan ( ) ) ) ;
770770 }
771- var args3 = funcs [ 2 ] . Calculate ( work ) ; if ( args3 . Type != OperandType . BOOLEAN ) { args3 = args3 . ToBoolean ( "Function '{0}' parameter {1} is error!" , "EndsWith" , 3 ) ; if ( args3 . IsError ) { return args3 ; } }
771+ var args3 = func3 . Calculate ( work ) ; if ( args3 . Type != OperandType . BOOLEAN ) { args3 = args3 . ToBoolean ( "Function '{0}' parameter {1} is error!" , "EndsWith" , 3 ) ; if ( args3 . IsError ) { return args3 ; } }
772772 return Operand . Create ( text . AsSpan ( ) . EndsWith ( args2 . TextValue . AsSpan ( ) , args3 . BooleanValue ? StringComparison . OrdinalIgnoreCase : StringComparison . Ordinal ) ) ;
773773 }
774774 public override void ToString ( StringBuilder stringBuilder , bool addBrackets )
0 commit comments