词条 | Instr() |
释义 | Instr() 函数返回字符或字符串在另一个字符串中第一次出现的位置. 表达式 Instr([start, ] strToBeSearched, strSearchFor [, compare]) 允许数据类型: Start为搜索的起始值,strToBeSearched接受搜索的字符串 strSearchFor要搜索的字符.compare比较方式(详细见ASP常数) 实例: <% strText = "This is a test!!" pos = Instr(strText, "a") response.write pos %> 返回结果: 9 备注:如果接受搜索的字符串中没有要搜索的字符串,则返回结果为0。 实例: <% strText = "This is a test!!" pos = Instr(strText, "b") response.write pos %> 返回结果: 0 |
随便看 |
百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。