laobaozi
V2EX  ›  iOS

NSInteger 删除 html 中的空格

  •  
  •   laobaozi · Oct 19, 2015 · 2472 views
    This topic created in 3980 days ago, the information mentioned may be changed or developed.

    使用 hpple 解析得到发表时间,比如

    element = [hppleElement searchWithXPathQuery:@"//td[3]/span[2]/text()[2]"];
    temp= [element objectAtIndex:0];
    NSString *content = [temp content];

    得到 content ="  •  置顶  •  最后回复来自"
    stringByReplacingOccurrencesOfString删除"•"和" "和"最后回复来自"
    得到
    content = "  置顶  "
    试过

    "  "


    `
    "  &nbsp "

    无效
    这里前置和后置的空格改怎么继续删除

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2940 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 08:55 · PVG 16:55 · LAX 01:55 · JFK 04:55
    ♥ Do have faith in what you're doing.