Skip to content

Instantly share code, notes, and snippets.

@matsuyoro
Created February 6, 2015 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsuyoro/a207fd2d6e8c3140a15f to your computer and use it in GitHub Desktop.
Save matsuyoro/a207fd2d6e8c3140a15f to your computer and use it in GitHub Desktop.
swift 指定の文字列の位置を最後から検索 ref: http://qiita.com/matsuyoro/items/b7146ae0d79abf845989
pos 9223372036854775807
var hogeNsStr:NSString = "yoshiganbaruzou yoshiyoshi"
var pos = hogeNsStr.rangeOfString("yoshi", options:NSStringCompareOptions.BackwardsSearch).location
println("pos \(pos)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment