How to split items in a string separated by comma:
You can split a string by using NString's componentsSeparatedByString method in iphone sdk.
Code:
You can split a string by using NString's componentsSeparatedByString method in iphone sdk.
Code:
NSString *strPasscode = @"A,B,C,D"; NSArray *arr = [strPasscode componentSeparatedBy:@","]; passcodeTxt1.text = [arr objectAtIndex:0]; passcodeTxt2.text = [arr objectAtIndex:1]; passcodeTxt3.text = [arr objectAtIndex:2];
passcodeTxt4.text = [arr objectAtIndex:3];
0 comments:
Post a Comment
Share your thoughts here...