Gregexpr(可用来判断一个字符串在另一个字符串中出现的位置)

a

[1] "I1" "I2" "I7"

> gregexpr("I1", a)[[1]][1]

[1] 1

原文地址:https://www.cnblogs.com/panlongfeng/p/6845245.html