在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
字符串长度: nchar("hello world") #字符串连接: aa<-unlist(strsplit(x, 'char')) aa[1] # first string
substr("abcdef", 2, 4) > x <- "1234567890"
> substr(x, 3, 3)
[1] "3"
>
> substr(x, 5, 7)
[1] "567"
>
> substr(x, 4, 4) <- "A"
> x
[1] "123A567890"
>
> substr(x, 2, 4) <- "TTF"
> x
[1] "1TTF567890"
>
> substr(x, 9, 12) <- "ABCD"
> x
[1] "1TTF5678AB"
>
> substring(x, 5)
[1] "5678AB"
>
> substring(x, 5) <- "..."
> x
[1] "1TTF...8AB"
## 包含子字符串: chars中是否包含value
#字符串比较: if(as.character(x)==as.character(y))
|
请发表评论