도래울

swift string search rangeOfString 본문

개발/iOS

swift string search rangeOfString

도래울 2016. 7. 19. 10:56
var string = "hello Swift"

if string.rangeOfString("Swift") != nil{
    println("exists")
}

// alternative: not case sensitive
if string.lowercaseString.rangeOfString("swift") != nil {
    println("exists")
}


Comments