更新时间:2023-02-21 20:09:46
SELECT
trim( -- trim removes spaces before and after given string
left(
'some text < iframe',
locate('< iframe', 'some text < iframe') - 1
)
);
为了更好地理解,我没有删除 和
iframe
之间的空格.
For better understanding i did not removed space between <
and iframe
.
你也可以看看这个帖子:
You may also take a look at this thread:
但这是关于仅删除标签并在标签之间保留
text 的讨论.无论如何它会适合你,因为你在
和
之间没有任何东西.
but this is discussion about removing tags only, and keeping <tag>
text</tag>
between tags. Anyway it will for for you, because you have nothing between <iframe>
and </iframe>
.