• <tfoot id='DZlT0'></tfoot>
  • <i id='DZlT0'><tr id='DZlT0'><dt id='DZlT0'><q id='DZlT0'><span id='DZlT0'><b id='DZlT0'><form id='DZlT0'><ins id='DZlT0'></ins><ul id='DZlT0'></ul><sub id='DZlT0'></sub></form><legend id='DZlT0'></legend><bdo id='DZlT0'><pre id='DZlT0'><center id='DZlT0'></center></pre></bdo></b><th id='DZlT0'></th></span></q></dt></tr></i><div id='DZlT0'><tfoot id='DZlT0'></tfoot><dl id='DZlT0'><fieldset id='DZlT0'></fieldset></dl></div>
      <bdo id='DZlT0'></bdo><ul id='DZlT0'></ul>
  • <legend id='DZlT0'><style id='DZlT0'><dir id='DZlT0'><q id='DZlT0'></q></dir></style></legend>

    <small id='DZlT0'></small><noframes id='DZlT0'>

      1. 目标 c 有带标签功能吗?

        Does objective c have a strip tags function?(目标 c 有带标签功能吗?)

            <tbody id='pkpCn'></tbody>
          <i id='pkpCn'><tr id='pkpCn'><dt id='pkpCn'><q id='pkpCn'><span id='pkpCn'><b id='pkpCn'><form id='pkpCn'><ins id='pkpCn'></ins><ul id='pkpCn'></ul><sub id='pkpCn'></sub></form><legend id='pkpCn'></legend><bdo id='pkpCn'><pre id='pkpCn'><center id='pkpCn'></center></pre></bdo></b><th id='pkpCn'></th></span></q></dt></tr></i><div id='pkpCn'><tfoot id='pkpCn'></tfoot><dl id='pkpCn'><fieldset id='pkpCn'></fieldset></dl></div>

                <legend id='pkpCn'><style id='pkpCn'><dir id='pkpCn'><q id='pkpCn'></q></dir></style></legend>
              1. <tfoot id='pkpCn'></tfoot>

                • <bdo id='pkpCn'></bdo><ul id='pkpCn'></ul>

                  <small id='pkpCn'></small><noframes id='pkpCn'>

                  本文介绍了目标 c 有带标签功能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在寻找一个目标 C 函数(自定义或内置),它可以从字符串中去除 html 标记,类似于可以在此处找到的 PHP 版本:

                  I am looking for an objective C function (custom or built-in) that strips html tags from a string, similar to PHP's version that can be found here:

                  http://php.net/manual/en/function.strip-tags.php

                  任何帮助将不胜感激!

                  推荐答案

                  这只是删除 <> 字符以及它们之间的所有内容,我认为这已经足够了:

                  This just removes < and > characters and everything between them, which I suppose is sufficient:

                  - (NSString *) stripTags:(NSString *)str
                  {
                      NSMutableString *ms = [NSMutableString stringWithCapacity:[str length]];
                  
                      NSScanner *scanner = [NSScanner scannerWithString:str];
                      [scanner setCharactersToBeSkipped:nil];
                      NSString *s = nil;
                      while (![scanner isAtEnd])
                      {
                          [scanner scanUpToString:@"<" intoString:&s];
                          if (s != nil)
                              [ms appendString:s];
                          [scanner scanUpToString:@">" intoString:NULL];
                          if (![scanner isAtEnd])
                              [scanner setScanLocation:[scanner scanLocation]+1];
                          s = nil;
                      }
                  
                      return ms;
                  }
                  

                  这篇关于目标 c 有带标签功能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  quot;Auto Layout still required after executing -layoutSubviewsquot; with UITableViewCell subclass(“执行 -layoutSubviews 后仍需要自动布局带有 UITableViewCell 子类)
                  How do I animate constraint changes?(如何为约束更改设置动画?)
                  How to change the preferred language of an iPhone app in iOS 4(如何在 iOS 4 中更改 iPhone 应用程序的首选语言)
                  NSLocale currentLocale always returns quot;en_USquot; not user#39;s current language(NSLocale currentLocale 总是返回“en_US;不是用户当前的语言)
                  How can I wait for a NSURLConnection delegate to finish before executing the next statement?(在执行下一条语句之前,如何等待 NSURLConnection 委托完成?)
                  handle when callback to a dealloced delegate?(何时回调已解除分配的委托?)
                    <bdo id='EBn2d'></bdo><ul id='EBn2d'></ul>
                          <tfoot id='EBn2d'></tfoot>

                            <tbody id='EBn2d'></tbody>

                          <small id='EBn2d'></small><noframes id='EBn2d'>

                          • <i id='EBn2d'><tr id='EBn2d'><dt id='EBn2d'><q id='EBn2d'><span id='EBn2d'><b id='EBn2d'><form id='EBn2d'><ins id='EBn2d'></ins><ul id='EBn2d'></ul><sub id='EBn2d'></sub></form><legend id='EBn2d'></legend><bdo id='EBn2d'><pre id='EBn2d'><center id='EBn2d'></center></pre></bdo></b><th id='EBn2d'></th></span></q></dt></tr></i><div id='EBn2d'><tfoot id='EBn2d'></tfoot><dl id='EBn2d'><fieldset id='EBn2d'></fieldset></dl></div>
                            <legend id='EBn2d'><style id='EBn2d'><dir id='EBn2d'><q id='EBn2d'></q></dir></style></legend>