swift学习---长句部分三(第一次计划看一本完整的英文资料,你是最棒的,加油)

compound assignment operator

复合赋值操作符

preceding[英]prɪ'si:dɪŋ[美]prɪˈsidɪŋ
adj.(时间或地点上)在先的,在前的,前面的;前述的;上述的
v.在…之前发生(或出现);走在…前面;先于;“precede”的现在分词

[例句] Many people closely follow the political polls during the final weeks preceding an important election.
有许多人密切关注着此次重要选举前最后几周进行的民意调查。

 

Avoid combining  multiple instance of the  ternary conditional operator into one
compound statement.
避免在一个组合语句中使用多个三目条件运算
Range Operators
区间运算
Closed Range Operator
闭区间运算符
The closed range operator is useful when iterating over a range in which you want all of the values to be used ,such as with a  for-in loop:
闭区间运算符在迭代一个区间的所有值时是非常有用的,如在 for-in 循环中。
 
Half-Closed Range Operator
半闭区间
If either value is false ,the overall  expression will also be false.
 
只要任意一个值为false,整个表达式的值就是false。
 
This is known as short-circuit  evaluation.
这个被称为短路计算
Combining Logical Operators
组合逻辑运算
We can conbine  multiple logical operators to create longer compound exprssions.
我们可以组合多个逻辑运算来表达一个复合逻辑
The emergancy override  password 紧急情况下的重置密码

如果重置密码必须更新连接

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 .

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
 
 
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值