JavaScript String 字符串方法汇总 1.str.indexOf() 方法查找字符串中的字符串 返回 字符串中指定文本首次出现的索引(位置) JavaScript 从零计算位置.0 是字符串中的第一个位置,1 是第二个,2 是第三个 ... 无法设置更强大的搜索值(正则表达式) var str = "The full name of China is the People's Republic of China."; var pos =
多行字符串: http://php.net/manual/zh/language.types.string.php#language.types.string.syntax.nowdoc DEMO: //heredoc 解析变量 <?php $str = <<<EOD //some codes you want to write //the end of the block should be a new line and have no space EOD; echo $str;
文件查找——搜索当前目录下的文件 知道大概的文件名称,使用 findf FileName findf.py import argparse, re, os from os.path import join parser = argparse.ArgumentParser() parser.add_argument('FILENAME', help='file name use regular expression') parser.add_argument('-e', metavar='EXCL