gsub() function in R Language is used to replace all the matches of a pattern from a string. If the pattern is not found the string will be returned as it is.
gsub(pattern, replacement, string, ignore.case=TRUE/FALSE)
pattern: string to be matched
replacement: string for replacement
string: String or String vector
ignore.case: Boolean value for case-sensitive replacement
 "Goodsforgoods"  "GeeksforBooks"  "BooksforBooks"
 "R Tutorial" "Java example" "Go-Lang Tutorial"  "R Tutorial" "Java Tutorial" "Go-Lang Tutorial"
- Find String Matches in a Vector or Matrix in R Programming - str_detect() Function
- Replace the First Match of a Pattern from a String in R Programming – sub() Function
- Replace the Elements of a Vector in R Programming - replace() Function
- Find position of a Matched Pattern in a String in R Programming – grep() Function
- Seek a Match for the Pattern in the String in R Programming - pmatch() Function
- Replace values of a Factor in R Programming - recode_factor() Function
- Check for a Pattern in the Vector in R Programming - grepl() Function
- Check if a Function is a Primitive Function in R Programming - is.primitive() Function
- Check if values in a vector are True or not in R Programming - all() and any() Function
- Create a Data Frame of all the Combinations of Vectors passed as Argument in R Programming - expand.grid() Function
- Generate all Combinations of xCm in R Programming - combn() Function
- Get a List of all the Attached Packages in R Programming - search() Function
- Get the Full Path of all the Attached Packages in R Programming - searchpath() Function
- List all the Objects present in the Current Working Directory in R Programming - ls() Function
- Get a List of all the 657 colors in R Programming - colors() Function
- Convert string from lowercase to uppercase in R programming - toupper() function
- Matching of patterns in a String in R Programming - agrep() Function
- Substitute characters of a String in R Programming - chartr() Function
- Convert String to Double Quote Text in R Programming - dQuote() Function
- Convert String to Single Quote Text in R Programming - sQuote() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.