V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
laobaozi
V2EX  ›  iOS

NSInteger 删除 html 中的空格

  •  
  •   laobaozi · Oct 19, 2015 · 2242 views
    This topic created in 3849 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   ·   863 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 18:49 · PVG 02:49 · LAX 11:49 · JFK 14:49
    ♥ Do have faith in what you're doing.