标题: 新手问题 [打印本页] 作者: shiyiming 时间: 2009-5-5 16:49 标题: 新手问题 一个函数问题
s='ABC.123 _xyZ_';
notupper(s,-4) → 4
为什么最后的结果是4,请好心人说明下search字符的顺序作者: shiyiming 时间: 2009-5-6 17:30 标题: Re: 新手问题 编程有问题作者: shiyiming 时间: 2009-5-6 17:49 标题: Re: 新手问题 查help,描述:
The NOTUPPER function searches a string for the first occurrence of a character that is not an uppercase letter. If such a character is found, NOTUPPER returns the position in the string of that character. If no such character is found, NOTUPPER returns a value of 0.
The direction in which to search is determined in the following way:
If the value of start is positive, the search proceeds to the right.
If the value of start is negative, the search proceeds to the left.
If the value of start is less than the negative length of the string, the search begins at the end of the string.作者: shiyiming 时间: 2009-5-22 05:04 标题: Re: 新手问题 结果应该是4。
notupper功能:“Searches a character string for a character that is not an uppercase letter and returns the first position at which that character is found ”
-4:从第四位开始向左查。发现第四位为“.”,不是大写的,所以返回值为4。