i have a json replay string and the data in that is some what like this
NSString *s = responseDrugInfo.genericname;
NSCharacterSet *doNotWant = [NSCharacterSet characterSetWithCharactersInString:@":"];
s = [[s componentsSeparatedByCharactersInSet: doNotWant] componentsJoinedByString: @""];
NSLog(@"%@", s);
"genName":"METFORMIN",
"mtr":" TEVA",
"comUse":" This medicine is a biguanide-type medicine used along with a diet and exercise program to control high blood sugar in patients with type 2 diabetes."
and i just want to display the data in a lable like this
METFORMIN
TEVA
This medicine is a biguanide-type medicine used along with a diet and exercise program to control high blood sugar in patients with type 2 diabetes.
and using the following code i am able to replace the colon symblo …
can any one please tell me how to trim the string up to the colon ie how to remove “genName”:
in advance….
You can do that with the help of following code:
And then divide your array in two parts take even numbers as your value.