全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
10830 5
2012-11-14
受到警告
翻遍了目前流行的stata教材,好像都很少涉及到字符型函数的讲解。于是只好寻求stata自身的help了。
但是,help indexnot之后,只给出了描述,没有给出example!看描述也看不太懂是啥意思……
在手册里去找,似乎也没有。看手册的内容,字符型函数的example要有的话,描述完了之后就会直接给出了。我猜测应该是没有indexnot的例子了。
在坛子里搜索“indexnot”也没有结果。
所以请求各位,给举个例子解释一下indexnot的用法吧~多谢多谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-11-14 12:28:24
indexnot(s1,s2) returns the position in s1 of the first character of s1 not found in s2, or 0 if all characters of s1 are found in s2.

刚开始,只关心一点即可:先将s1与s2看成两个字符集(它们可以是空集),若s1是s2的子集,则其值0,否则其值非0。

https://bbs.pinggu.org/thread-747231-1-1.html
https://bbs.pinggu.org/thread-954275-1-1.html
https://bbs.pinggu.org/thread-893472-1-1.html
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-14 15:16:05
sungmoo 发表于 2012-11-14 12:28
indexnot(s1,s2) returns the position in s1 of the first character of s1 not found in s2, or 0 if all ...
谢谢回答!我自己再琢磨一会儿~
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-14 16:03:57
简单(重复地)说,indexnot()的作用主要是,考察s1中的字符是否全在s2中出现过(是=0,否>0)。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-12-28 09:58:48
. display indexnot("ab", "carribean")
0
. display indexnot("ab","tab")
0
. display indexnot("ab","tt")
1
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-9-21 10:39:53
应该用regexm()比较准确。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群