String operator* - JanKulbaga/String-CPP GitHub Wiki

String operator*

Returns a newly constructed string object whose value is num times the value of s.

Example

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

int main()
{
    String s = "Hello";
    String s1 = s * 3;
    std::cout << s1;
    return 0;
}

Output:

HelloHelloHello

Parameters

const String& s

size_t num

Return type

A new string whose value is num times the value of s.

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