objective c - Filtering string for date -
objective c - Filtering string for date -
i have string looks this:
"51403074 0001048713 1302130446 tomtom101 order 51403074-3-278065518: ontvangen"
this string filtered array contains similar strings. string contains relevant info , irrelevant data. part of string relevant is:1302130446
. number represents date , time (yy/mm/dd/hh/mm). because part date , time not same every time.
how can filter string have string contains relevant part.
sorry still learning ios dev.
if date string 3rd word split nsstring word array as
nsstring *mystring = @"this test"; nsarray *mywords = [mystring componentsseparatedbystring:@" "];
and access 3rd item in array string wanted.
edit (due comment): sure right string word array need unique identifier string. 'tomtom101' follows date string or thing else...
**edit 2 (due need of illustration code)
nsuinteger counter = 0; nsuinteger datestringindex = 0; for(nsstring *str in mywords) { counter ++; if([str isequaltostring:@"tomtom101"]) { datestringindex = counter - 1; //we know word date number, can stop looping. break; } }
(not compiled code)
objective-c cocoa-touch cocoa
Comments
Post a Comment