<p>I want to insert 'n' spaces (or any string) at the beginning of a string in C++. Is there a direct way to do this using either std::strings or char* strings?</p>
<p>E.g., in Python you could simply do</p>
<pre><code>&gt;&gt;&gt; &quot;.&quot; * 5 + &quot;lolcat&quot;
'.....lolcat'
</code></pre>

In the particular case of repeating a single character, you can use
```
std::string(size_type count, CharT ch)
```
:
```
```
std::string(5, '.') + "lolcat"
```
```
This can't be used to repeat multi-character strings.