|
用途
返回父串中子串的下标,如果父串中不存在该子串就返回0
语法
instr(string1, string2 [, start_position [, nth_appearance ] ] )
string1,父串;
string2,子串;
start_position,查找的起始位置;
nth_appearance,第几次出现;
示例
instr('Tech on the net', 'e') would return 2; the first occurrence of 'e'
instr('Tech on the net', 'e', 1, 1) would return 2; the first occurrence of 'e'
instr('Tech on the net', 'e', 1, 2) would return 11; the second occurrence of 'e'
instr('Tech on the net', 'e', 1, 3) would return 14; the third occurrence of 'e'
instr('Tech on the net', 'e', -3, 2) would return 2. |
|