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

    <legend id='DCa3D'><style id='DCa3D'><dir id='DCa3D'><q id='DCa3D'></q></dir></style></legend>

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

    2. <tfoot id='DCa3D'></tfoot>

      1. 正则表达式匹配最后一个空格字符

        时间:2023-10-13

            <tbody id='eRJDt'></tbody>

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

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

            <tfoot id='eRJDt'></tfoot>

                  <bdo id='eRJDt'></bdo><ul id='eRJDt'></ul>
                  本文介绍了正则表达式匹配最后一个空格字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我需要一些帮助.我正在寻找一个匹配字符串中最后一个空格字符的正则表达式.我正在使用 JavaScript 和经典 ASP.

                  I need some help. I am looking for a regex that would match the last space character in a string. I am using JavaScript and classic ASP.

                  我有一长串文本,我将其修剪为 100 个字符.如果修剪由于 100 个字符的限制而剪切了一个单词,我想删除最后一个字符以避免拼写错误.

                  I have a long string of text which I trim to 100 characters. I would like to remove the last character to avoid a spelling mistake if the trim cuts a word due to the 100 characters limit.

                  regex.replace(/[ ]$.*?/ig, '');
                  

                  有人有想法吗?谢谢.

                  推荐答案

                  根据我的理解,你需要删除最后一个空格和后面的所有内容,对吧?

                  From my understanding, you need to remove the last space and everything after it, right?

                   str = str.replace(/s+S*$/, "")
                  

                  这篇关于正则表达式匹配最后一个空格字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 ActiveX 获取用户名 下一篇:如何使用经典 ASP 保存画布图像?

                  相关文章

                  最新文章

                    • <bdo id='RxbES'></bdo><ul id='RxbES'></ul>
                  1. <tfoot id='RxbES'></tfoot>

                  2. <legend id='RxbES'><style id='RxbES'><dir id='RxbES'><q id='RxbES'></q></dir></style></legend>

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

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