如何删除某个单词后的文字 [英] How to remove text after certain word

查看:20
本文介绍了如何删除某个单词后的文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个字符串

The best laid schemes of mice and men

如何在 ColdFusion 中删除方案"一词后的所有文本?我想这可以用正则表达式来完成.

How do I remove all text after the word "schemes" in ColdFusion? I suppose this can be done with regex.

推荐答案

来吧:

<cfset myString = "The best laid schemes of mice and men" />
<cfoutput>#REReplace(myString, "schemes(.*)", "schemes")#</cfoutput>

这篇关于如何删除某个单词后的文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆