Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有一个像 /Users/me/Documents/code/maccode/myApp/Icon.png 这样的字符串
我应该怎么做才能只留下“Icon.png”?
使用 xcode 并使用目标 c 编写 mac 应用程序。
提前致谢。
NSString *filename = @"/Users/me/Documents/code/maccode/myApp/Icon.png"; NSString *path = [filename lastPathComponent];
那会给你Icon.png
Icon.png