iphone - Extracting data(strings) from a string large string -


a long time ago had extract data string, , went while loop went through whole string char char extracting bits of data need. wasn't efficient worked.

in latest app try , in way engineer it. there ways search string expression? or sub string maybe?

for example out of html in string, there line contain team name.

<td width="25%"><span class="teamname">blue bombers</span></td> 

is there call can find "teamname" , extract teamname between > <.

i go char char saving last 10 chars string until string equals "teamname", keep going until hit > save until again hit <. guess thats taking easy inefficient way.

many -code

you can range of string "class" using nsrange, logic... reduce character searching..

your code should follows,

if ([substring rangeofstring:@"class"].location != nsnotfound) {     // "class" found else {     // "class" not found } 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -