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.
Pythonのように、新しい配列を簡単に取得することを意味します。
lst[:-1]
objcでそれを行う方法はありますか?
-subArrayWithRange:を使用できます。
[theOriginalArray subarrayWithRange:NSMakeRange(0, [theOriginalArray count]-1)]
lst[0:lst-1]これは、の拡張形式であるPython式と同等lst[:-1]です。
lst[0:lst-1]