character(lenght = 0):
as.character(x, ...):
is.character(x):
#连接字符向量
paste(..., sep=" ", collapse=NULL)
#获取或替换字符串的一部分
substr(x, start, stop)
substring(text, first, last=1000000L)
substr(x, start, stop) <- value
substring(text, first, last=1000000L) <- value
#获取字符串长度
nchar(x, type="chars", allowNA=FALSE) #type <- c("bytes", "chars", "width")
nzchar(x)
#分割字符向量mi
strsplit(x, split, fixed=FALSE, perl=FALSE, useBytes=FALSE) #fixed是否使用正则表达式, perl是否使用perl风格的正则表达式
#格式化打印
sprintf(fmt, ...)
grep(pattern, x, ignore.case = FALSE, perl = FALSE, value = FALSE,
fixed = FALSE, useBytes = FALSE, invert = FALSE)
grepl(pattern, x, ignore.case = FALSE, perl = FALSE,
fixed = FALSE, useBytes = FALSE)
sub(pattern, replacement, x, ignore.case = FALSE, perl = FALSE,
fixed = FALSE, useBytes = FALSE)
gsub(pattern, replacement, x, ignore.case = FALSE, perl = FALSE,
fixed = FALSE, useBytes = FALSE)
regexpr(pattern, text, ignore.case = FALSE, perl = FALSE,
fixed = FALSE, useBytes = FALSE)
gregexpr(pattern, text, ignore.case = FALSE, perl = FALSE,
fixed = FALSE, useBytes = FALSE)
regexec(pattern, text, ignore.case = FALSE,
fixed = FALSE, useBytes = FALSE)