swift 3.0 String和NSString去空格等边界字符已经变为
let str5:NSString = "111 "
str5.length
let str6 = "test "
str6.characters.count
str5.trimmingCharacters(in: CharacterSet(charactersIn: " "))
str6.trimmingCharacters(in: CharacterSet(charactersIn: "!@#$%^&*( "))
let str5:NSString = "111 "
str5.length
let str6 = "test "
str6.characters.count
str5.trimmingCharacters(in: CharacterSet(charactersIn: " "))
str6.trimmingCharacters(in: CharacterSet(charactersIn: "!@#$%^&*( "))
2016-09-27
最新回答 / 范子祺
好像是没有了,,,
山居说的没错,另外还有一处...
5:00左右的地方提到java 求余问题,其实java也能做,只不过2.5%1.2=0.10000000000000009
5:00左右的地方提到java 求余问题,其实java也能做,只不过2.5%1.2=0.10000000000000009
2016-09-21
swift3.0输出有误为什么呢?
let point = (8,0)
switch point{
case (0,0):
print("It's oringin.")
fallthrough
case (_,0):
print("It's on the x-axis.")
fallthrough
case (0,_):
print("It's on the y-axis.")
default:
()
}
输出:
It's on the x-axis.
It's on the y-axis.
let point = (8,0)
switch point{
case (0,0):
print("It's oringin.")
fallthrough
case (_,0):
print("It's on the x-axis.")
fallthrough
case (0,_):
print("It's on the y-axis.")
default:
()
}
输出:
It's on the x-axis.
It's on the y-axis.
2016-09-18