从设计的角度看,有些其他的选择是有问题的;例如,使用字符串来承载运算符就有可能出现小的输入错误,最终会导致结果不正确。
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.
基于Jython内置字典的字符串格式化与c中printf的一样强大,我们可以使用%运算符来关联字典。
With Jython's built in dictionary based String formatting which is as powerful as printf in c, we can associate a dictionary using the % operator.
我们的平台上的发现模式能够提供广泛的运算符、逻辑运算符、通配符字符串搜索等。
Find mode on our platform can accommodate logical a wide array of operators, logical operators, wildcard string searches, etc.
第二,如果需要重复短字符串来创建长字符串,可以使用 *运算符,将字符串重复一定的次数。
Second, if you need to repeat a small string to create a bigger string, you can use the * operator, which multiplies a string out a set number of times.
和字符串不同的是,列表是可以修改的。方括号运算符放到一个赋值语句的等号左侧的时候,就会把对应位置的列表元素重新赋值。
Unlike strings, lists are mutable. When the bracket operator appears on the left side of an assignment, it identifies the element of the list that will be assigned.
格式运算符:%运算符,处理字符串和元组,然后生成一个包含元组中元素的字符串,根据给定的格式字符串进行格式化。
An operator, %, that takes a format string and a tuple and generates a string that includes the elements of the tuple formatted as specified by the format string.
格式字符串:用于格式运算符的一个字符串,内含格式序列。
A string, used with the format operator, that contains format sequences.
串联运算符将多个字符串联接为一个字符串。
Concatenation Operators join multiple strings into a single string.
另外一个方法就是用格式运算符,也就是百分号%。在用于整数的时候,百分号%是取余数的运算符。但当第一个运算对象是字符串的时候,百分号%就成了格式运算符了。
An alternative is to use the format operator, %. When applied to integers, % is the modulus operator. But when the first operand is a string, % is the format operator.
表达式可以使用在常数值、命令的退出代码、字符串、宏和文件系统路径上使用的运算符。
Expressions can use operators that act on constant values, exit codes from commands, strings, macros, and file-system paths.
使用指定的运算符和数据类型比较两个字符串。
Compares two strings using the specified operator and data type.
使用指定的运算符和验证数据类型比较两个字符串。
Compares two strings using the specified operator and validation data type.
表达式可以由数学计算或字符串组成,也可以包含列名、文本、运算符或函数的任意组合。
An expression can consist of a mathematical calculation or a string, and can involve any combination of column names, literals, operators, or functions.
对于数可使用标准算术运算符,对于组合字符串可使用串联运算符。
Use standard arithmetic operators for Numbers and a concatenation operator for combining strings.
对于数可使用标准算术运算符,对于组合字符串可使用串联运算符。
Use standard arithmetic operators for Numbers and a concatenation operator for combining strings.
应用推荐