objective c getting substring after and before dot
iphone, objective-c
Solution
Try the following:
NSArray *arrayWithTwoStrings = [yourString componentsSeparatedByString:@"."];
Using this method you'll get NSArray containing string components that were separated by "." string, that is "112" and "1" for "112.1" string. After that you can access them using array's `objectAtIndex:` method.
P.S. Note also that if you're going to use numeric values of those strings there might be better solution
Problem
i have a string like 112.1 or 102.2 etc now i want to get the substring before dot and after the dot using objective c, means i want to get 2 substrings like this 112 and 1. please guide. Regards Saad.