I have the following NSString:
NSString
productID = @\"com.sortitapps.themes.pink.book\";
At the end, \"book\" can be anything.... \"music\
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.
-[NSString componentsSeparatedByString:@"."]
[NSArray componentsJoinedByString:@"."]