String operator plus - JanKulbaga/String-CPP GitHub Wiki

String operator+

Returns a newly constructed string object with its value being the concatenation of the characters in s1 followed by those of s2.

Example

#include <ostream>
#include "src/String.h"

int main()
{
    String s = "Hello ";
    String s1 = "World";
    String s2 = s + s1;
    std::cout << s2;
    return 0;
}

Output:

Hello World

Parameters

const String& s1

const String& s2

Return value

A new string whose value is the concatenation of s1 and s2

⚠️ **GitHub.com Fallback** ⚠️