String
Text file reading
Use readLines()
read
using scan()
reading
wherein when a parameter sep="\n"
, the row read, what=
specify the data type read
String concatenation
Using paste()
function connection string
String split
Use strsplit()
function split
returns a list, you can use the unlist()
View
String search
Using the grep()
function returns the index of the default
use of grepl()
the function, the return value is a logical value
Using the regexpr()
function
-1 indicates a mismatch, the match represents 1
using gregexpr()
the function search
returns the matching of each element in a list
regexec()
similar effect
String replacement
sub()
Character function replaces the first match, the gsub()
function replaces all occurrences of characters
String extraction
Use surstr()
functions to extract , can be assigned directly