字符串运算符,有两个字符串运算符。第一个是连接运算符(“.”),它返回其左右参数连接后的字符串。第二个是连接赋值运算符(“.=”),它将右边参数附加到左边的参数后。更多信息见赋值运算符。
从设计的角度看,有些其他的选择是有问题的;例如,使用字符串来承载运算符就有可能出现小的输入错误,最终会导致结果不正确。
From a design perspective, some other choices are questionable; for example, the use of Strings to hold the operators opens up the possibility of small typos leading to erroneous results.
第一,通过将其他字符串添加在一起,可以创建新的字符串,具体方法可以使用+运算符,或者干脆使用适当的引号将字符串连在一起。
First, you can create a new string by adding other strings together, either using the + operator or by just sticking strings together using the appropriate quotes.
惟一的区别就是它使用Jython字典来保存String模板里的名称-值对,并使用%运算符来将该模板转换为有意义的sql字符串。
The only difference is the use a Jython dictionary to hold name, value pairs within a String template while use % operator to evaluate this template into a String of meaningful SQL.
应用推荐