方括号运算符用来检索数组和集合的元素。
The bracket operator is used to retrieve elements of arrays and collections.
和字符串不同的是,列表是可以修改的。方括号运算符放到一个赋值语句的等号左侧的时候,就会把对应位置的列表元素重新赋值。
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.
注意,最初的 “最小字符数”子模式和运算符子模式都在捕捉圆括号内进行了指定:\(...\)。
Note that both the initial "minimal number of characters" subpattern and the operator subpattern are specified within capturing parentheses: \(...\).
最后,我们看到第二个子表达式,它除了有由方括号组成的“不引用”运算符外,还有一个加号。
Finally, we get the second child subexpression, which other than the "don't refer" operator consists of some stuff in square brackets, and a plus sign.
表达式中可能使用括号来指明运算顺序,这和数学当中是一样的。
Parentheses may be used in an expression to indicate the order of operations, in the same way they are used in mathematics.
第一个约定是在方法调用中使用 Ruby的圆括号(可选);第二个约定就是使用半专有的方法命名,其中使用了在其他语言中作为运算符的符号。
The first element of this is Ruby's optional parentheses in method calls; the second part is its use of semi-special naming of methods with symbols that are operators in most languages.
使用括号来明确运算顺序。
跟圆括号一起使用少量数学运算子,你可以执行更多普遍的计算。
Using a handful of mathematical operators along with the parentheses, you can perform the most common calculations.
查询无效:确保括号完整,自定义查询只包含有效标准数字以及布尔型运算符and、OR和NOT。
Invalid query: make sure parenthesis are balanced and the custom query consists only of valid criteria Numbers and the Boolean operators and, or, and NOT.
使用运算符的一个缺点是括号的运用经常容易搞错。即使对一个表达式如何计算有丝毫不确定的因素,都容易混淆括号的用法。
One of the pitfalls when using operators is trying to get away without parentheses when you are even the least bit uncertain about how an expression will evaluate.
只需将查询表达式括在括号内,然后应用点运算符并调用此方法。
Just enclose the query expression in parentheses, and then apply the dot operator and call the method.
因此,在一串没有括号的由幂运算符和一元运算符组成的序列,会从左到右面求值(没有强制改变求值顺序)。
Thus, in an unparenthesized sequence of power and unary operators, the operators are evaluated from right to left (this does not constrain the evaluation order for the operands).
若要覆写预设的优先顺序,请在运算式中优先评估部分的前后加上括号。
To override the default precedence, use parentheses around the portion of the expression that is to be evaluated first.
您可以使用括号,强制优先评估运算式的某部分。
You can use parentheses to force some parts of an expression to be evaluated before others.
如果被测试表达式中应当包含按位或运算符,则应当在条件表达式的两侧加上括号。
If the tested expression should contain the bitwise-or operator, then parentheses should be added around the conditional-expression.
包含括号以建立运算子的优先顺序。
包含括号以建立运算子的优先顺序。
应用推荐