// **Day 11
// **swift 2.0 String
var arr = [1,"2",3.3]
print("\(arr)")
var dict = ["a":1,"b":2,"c":3]
(dict as NSDictionary).allKeys
(dict as NSDictionary).allValues
var string = "hello world!"
let range = string.startIndex..<string.startIndex.advancedBy(5)
string.replaceRange(range, with: "Hi")
string
print("\(string)")
let range2 = string.endIndex.advancedBy(-6)..<string.endIndex
string.substringWithRange(range2)
var animals = "\u{1F60E}hoho~"
animals.characters.count
var swift_string = "symbol2.0"
let string2 = swift_string + "ahaha~"
print("\(string2)")
swift_string
swift_string.appendContentsOf("addString")
print("\(swift_string)")
var i = 1
for ; i <= 100 ; {
i*i
i += 1
}
for var a = -6.28 ; a <= 6.28 ; a += 0.2 {
sin(a)
cos(a)
tan(a)
1/tan(a)
}
var newstring = "hello world!"
for var c in newstring.characters {
print("\(c)")
if c == "r" {
c = " "
print("\(newstring.endIndex)")
}
print("\(c)")
}
print("\(newstring)")