If I have a string NSString *string = "2.233.12";
I need to trim everything after the second period, including the period itself. So the result will be "2.233"
.
If the string is NSString *string = "2.3.19"
, the result will be "2.3"
If the string is NSString *string = "2.50.99"
, the result will be "2.50"
What's the best way to accomplish this in Objective-C?