Beginner Swift Note flow control (v)

Source: Internet
Author: User

1 Import Foundation2 3  for varI=1; i<=Ten; i++ {4 println (i)5     }6 7Let str1="ADL;FJASDFL;OUEWROUQWPERUADF"8  forCinchstr1 {9     SwitchC {Ten          Case "a","F","o": One println (c) A          -         default: -             vart="" the          -     } - } - varx= + + Switchx { -  Case 1...9 : +println"Digit number") A  Case Ten... About: atprintln"10-digit number") -  Case  -...999: -println"number of hundred") -  Case  +...9999: -println"thousand number") - default: in     vart="" - } to  + varPoint = (Ten,Ten) - Switchpoint{ the  Case(0,0): *println"0,0") $  Case(1...Ten,1...Ten):Panax Notoginsengprintln"x:\ (point.0)-y:\ (Point.1)") -  Case(_,Ten): theprintln"xxxxx") + default: A     vart="" the } + //Value Binding - Switchpoint{ $  Case(Let X,Ten): $ println (x) -  CaseLet (x, y): -println"two values are bound") the  CaseLet (x, y)wherex = =y: -println"determine if the values are equal before binding")Wuyi default: the     vart="" -}

Beginner Swift Note flow control (v)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.