Related Articles

Related Articles

Concatenate Two Strings in R programming – paste() method
  • Last Updated : 28 May, 2020

paste() method in R programming is used to concatenate the two string values by separating with delimiters.

Syntax: paste(string1, string2, sep=)

Return: Returns the concatenate string.

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R program to concatenate two strings
  
# Given Strings
string1 <- "Geeks"
string2 <- "Geeks"
  
# Using paste() method
answer <- paste(string1, string2, sep=" For ")
  
print(answer)

chevron_right


Output:

[1] "Geeks For Geeks"

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R program to concatenate two strings
  
# Given Strings
string1 <- "I Love"
string2 <- "R programming"
  
# Using paste() method
answer <- paste(string1, string2, sep=" ")
  
print(answer)

chevron_right


Output:

[1] "I Love R programming"
My Personal Notes arrow_drop_up
Recommended Articles
Page :