2021年2月5日星期五

Obj-C - Get first X number of characters after a certain point in NSString?

I have a string like so:

NSString *testing = @"Feb 5 2021 05:00 PM, Feb 6 2021 07:00 PM";   

That said, I want my code to be able to grab the 8 characters after "Feb 5, 2021" and put them into another string (05:00 PM). Any idea how I can accomplish this? I'm stumped, as I only want it to grab that time, and not the other characters after it.

https://stackoverflow.com/questions/66072598/obj-c-get-first-x-number-of-characters-after-a-certain-point-in-nsstring February 06, 2021 at 09:06AM

没有评论:

发表评论