Groovy - How to compare the string?

后端 未结 7 1649
醉话见心
醉话见心 2021-02-04 23:03

how to compare the string which is passed as a parameter

the following method is not working.

 String str = \"saveMe\"

 compareString(str)

 def         


        
7条回答
  •  别跟我提以往
    2021-02-04 23:30

    use def variable, when you want to compare any String. Use below code for that type of comparison.

    def variable name = null

    SQL query give you some return. Use function with return type def.

    def functionname(def variablename){

    return variable name

    }

    if ("$variable name" == "true"){

    }

提交回复
热议问题