复合赋值操作符
preceding | [英]prɪ'si:dɪŋ | [美]prɪˈsidɪŋ |
adj. | (时间或地点上)在先的,在前的,前面的;前述的;上述的 |
v. | 在…之前发生(或出现);走在…前面;先于;“precede”的现在分词 |
Avoid combining multiple instance of the ternary conditional operator into one
如果重置密码,则必须更新该连接。
If youresetthepassword,youmust updatetheconnection.
Explicit Parentheses
使用扩后来明确优先级
Readability is always preferred over brevity; use parentheses where they help to make your intensions clear.
可读性比简洁性更重要,请在可以让你的代码更加清晰的地方加一个括号吧。
String and character
字符串与字符
String can also be used to insert constants ,variables,literals,and expressions into
longer strings, in a process konwn as string interpolation .
String 也可以用来在长字符串中插入常量、变量、字面量和表达式,这一过程称为字符串插值。
String Literals
字符串自变量
line feed
换行
carriage return
回车
String mutability
字符串科可变性
Strings are value type.
字符串是值类型
Working with Characters
使用字符串
Alternatively,create a stand-alone Character or variable from a single-character string literal by providing a Character type annotation:
另外通过标明一个character 类型注解并通过字符字面量进行赋值,可以建立一个独立的
字符常量或者变量
Concatenating String and Characters.
连接字符串和字符
String interpolation 字符串插值
Comparing String 比较字符串
Uppercase and Lowercase Strings
大写字符串和小写字符串
Unicode Terminology unicode术语
Dictionaries store unorderd collections of values of the same type ,which can be referenced and looked up throught a unique identigier(also known as a key ).
字典虽然无序存储类型相同数据值但是需要由独有的标志符引用和寻址(就是键值对)
Array Type Shorthand Syntax
数组的简单语法
You access and modify an array throught its method and properties,or by using subscript syntax.
你可以通过数组的方法和属性来访问和修改数据,或者下标语法。
Iterating Over an Array
数组的遍历
Creating and Initializing an Array
创建并初始化一个数组
Dictionaries
字典
A dictionary is a container that stores multiple values of the same type .Each value
is associated with a unique key,which acts as an identifier for that value within the
dictionary .
字典是一个存储相同类型多重数据的存储器。
每个字都关联独特的键,
键在这个字典中作为值数据的标识符。
with the var introducer var关键字
The airports dictionary is initialized with a dictionary literal containing two-value pairs.
airports字典使用字典字面语句初始化,包含两个键值对.
You access and modify a dictionary throught its method and properties,or by using subscript syntax.
我们可以通过字典的方法和属性来读取和修改字典,或者使用下标语法。
You can also use subscript syntax to retrieve a value from the dicctionary for a
particular key .