How do I use NSRange with this NSString?

前端 未结 3 414
Happy的楠姐
Happy的楠姐 2021-01-22 02:33

I have the following NSString:

productID = @\"com.sortitapps.themes.pink.book\";

At the end, \"book\" can be anything.... \"music\

3条回答
  •  北海茫月
    2021-01-22 02:57

    You can use -[NSString componentsSeparatedByString:@"."] to split into components, create a new array with your desired values, then use [NSArray componentsJoinedByString:@"."] to join your modified array into a string again.

提交回复
热议问题