全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
11744 15
2010-04-19
RT~本人不是很明白这个函数~
请高手指点一下吧~非常谢谢~
二维码

扫码加我 拉你入群

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

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

全部回复
2010-4-19 10:03:13
find(str,substr[,modifiers][,start_pos])
find(str,substr[,start_pos][,modifiers])
Searches a string for a substring and returns the first position
at which it’s found, or zero (0) if it’s not found. For a descrip-
tion of  start_pos see any<chartype> (p. 10). modifiers is one
or more of the values listed in the following table.
modifiers Means
i Ignore character case during the search. If this modifier
is omitted, the search is case-sensitive.
t Trim trailing spacing from str and substr.
Examples:
str='She sells seashells? Yes, she does.';
find(str,'she ') → 27.
find(str,'she ','i') → 1.
find(str,'she ','i',5) → 27.
find(str,'she ','it',5) → 14.
find(str,'she ','it') → 1.
二维码

扫码加我 拉你入群

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

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

2010-4-19 10:17:11
版主说得挺清楚了,楼主sas help多看看,很有"帮助"的
二维码

扫码加我 拉你入群

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

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

2010-4-19 10:34:01
谢谢各位~本人不才~
help里没看懂~才来请教的~
~~o(>_<)o ~~
二维码

扫码加我 拉你入群

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

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

2010-4-19 11:16:28
find有两种返回值,找到的返回找到的第一个字符位置,没找到则返回“0”,一般结合字符截取函数如substr()使用

str='She sells seashells? Yes, she does.';
find(str,'she ') → 27.   
      区分大小写,从str第1个字符开始查找,返回位置27
find(str,'she ','i') → 1.
     不区分大小写,从str第1个字符开始查找,返回位置1
find(str,'she ','i',5) → 27.
     不区分大小写,从str第5个字符开始查找,返回位置27
find(str,'she ','it',5) → 14.
      不区分大小写,不匹配‘she ’和str空白字符,从str第5个字符开始查找,返回位置14
find(str,'she ','it') → 1.
       不区分大小写,不匹配‘she ’和str空白字符,从str第1个字符开始查找,返回位置1
二维码

扫码加我 拉你入群

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

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

2010-4-19 11:27:28
楼主这样你该明白了吧
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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