Use hasPrefix
This commit is contained in:
parent
f367d663ae
commit
2fd2a10432
|
@ -13,7 +13,7 @@ class ASSerial {
|
||||||
let devices = NSFileManager.defaultManager().contentsOfDirectoryAtPath("/dev", error: nil)!
|
let devices = NSFileManager.defaultManager().contentsOfDirectoryAtPath("/dev", error: nil)!
|
||||||
var cuDevs = [String]()
|
var cuDevs = [String]()
|
||||||
for dev in devices as [String] {
|
for dev in devices as [String] {
|
||||||
if dev.substringToIndex(dev.startIndex.successor().successor()) == "cu" {
|
if dev.hasPrefix("cu") {
|
||||||
cuDevs.append("/dev/"+dev)
|
cuDevs.append("/dev/"+dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user