testindex.pl

来自「测试glob的使用」· PL 代码 · 共 10 行

PL
10
字号
$string1="hello";
$string2="how are you hello world!";
$where1=index($string2,$string1);
#check out the string1 in the string2.
#The string1 is the main string and the string2 is the substring.
$where2=index($string2,$string1,23);
#The third param shows the position starting.
$where3=rindex($string2,"o");
#This function will give the exact position where the letter of 'o' appear during last time.
print "$where1\n","$where2\n","$where3\n";

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?