Abilitare JavaScript per vedere questo sito.

Operatore di aggiunta e concatenazione stringa.

Sintassi

string &operator+=(const string &in source)

string &operator+=(double source)

string &operator+=(float source)

string &operator+=(int64 source)

string &operator+=(uint64 source)

string &operator+=(bool source)

source

Valore sorgente

Risultato

Rende riferimento a stringa risultante

Esempio di utilizzo:

string source1("il valore è ");

string source2("stringa2");

 

string target1 = source1 + source2; /*! target1 contiene "il valore è stringa2" */

string target2 = source1 + "stringa3"/*! target2 contiene "il valore è stringa3" */

string target3 = source1 + 1000; /* target3 contiene "il valore è 1000" */

string target4 = source1 + 3.14; /* target4 contiene "il valore è 3.14" */

 

source1 += " quasi " + -1000; /* source1 ora contiene "il valore è quasi -1000" */

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC