在字符串中搜索子字符串? Access女士...... [英] search substring in a string ? Ms Access...

查看:67
本文介绍了在字符串中搜索子字符串? Access女士......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



问题: - 使用Ms Access命令行搜索字符串中的子字符串...

exp: -

i有一个诸如门后有一只猫这样的行

i希望从给定的行中获得背后字......



Ms访问数据库: -

给予

告诉

落后

rat



............................................ ....

基本上我想搜索长字符串中的子字符串...

textbox包含该字符串...

- ------------------------------

thnxs提前


Question:-Search substring in a string using Ms Access Command line ...
exp:-
i have a line such as "There is a cat behind door"
i want to get "Behind" Word from the given line ...

Ms Access Database:-
Give
Told
Behind
rat

................................................
basically i want to search a substring in a long string ...
textbox contain that string ...
-------------------------------
thnxs in advance

推荐答案

这很复杂,但是......

This is complicated, but...
SELECT * FROM MyTable WHERE INSTR('There is a cat behind door', ' ' + UName + ' ') <> 0

会这样做。

复杂的是它赢了;在字符串的开头找到它们,或者最后,它不适用于标点符号等等:我留给你的那些!



就个人而言,我不会尝试在SQL:我使用一种正确的语言,具有更好的字符串处理和表示能力,比如C#甚至VB。

Will do it.
The complications are that it won;t find them at the beginning of the string, or the end, it doesn't work with punctuation, and so forth: those I leave to you!

Personally, I wouldn't try to do it in SQL: I'd use a "proper" language with better string handling and presentation abilities, like C# or even VB.


这篇关于在字符串中搜索子字符串? Access女士......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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