laobaozi
V2EX  ›  iOS

NSInteger 删除 html 中的空格

  •  
  •   laobaozi · Oct 19, 2015 · 2274 views
    This topic created in 3862 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   ·   Solana   ·   3050 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:40 · PVG 17:40 · LAX 02:40 · JFK 05:40
    ♥ Do have faith in what you're doing.