菜鸟教程小白 发表于 2022-12-12 13:12:56

ios 在构建字符串时我需要重用相同的占位符


                                            <p><div>
            <aside class="s-notice s-notice__info post-notice js-post-notice mb16"role="status">
      <div class="d-flex fd-column fw-nowrap">
            <div class="d-flex fw-nowrap">
                <div class="flex--item wmn0 fl1 lh-lg">
                  <div class="flex--item fl1 lh-lg">
                        <b>这个问题在这里已经有了答案</b>:
                        
                  <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>你可以这样做吗:</p>

<pre><code>NSString *placeholderStr = @&#34;_&#34;;
NSString *searchStr = [@&#34;(Name LIKE &#39;%%_%%&#39; OR Contact LIKE &#39;%%_%%&#39;&#34; stringByReplacingOccurrencesOfString: placeholderStr withString: ];
</code></pre>

<p>这会将所有下划线 (_) 替换为 <code>txtfSearch</code> 中的任何文本。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios 在构建字符串时我需要重用相同的占位符,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/17933354/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/17933354/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios 在构建字符串时我需要重用相同的占位符