String Interpolation
Let’s learn how to concatenate strings using string interpolation.
String Concatenation
To concatenate two strings means to join them together. Concatenation of two or more strings is done using the +
operator.
Press + to interact
main() {String s1 = "First half of the string. ";String s2 = "Second half of the string";print(s1 + s2);}
The code above is pretty simple. On line 4 we are concatenating the first string, s1
, and the second string, s2
, and then printing the ...
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy