If the two arrays/strings has the same size, using
pawn Код:
new string1[8] = "Hello",string2[8] = "world!";
string1 = string2;
will be the fastest (and easy to use).
If you want to add some more strings behind a string you can use strcat/strcpy.
However, if more than 4-5 strcat is required to make a string, or there's non-string values to be added into the string, format will be faster.
pawn Код:
new string[128] = "Hello,",playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
strcat(string,playername);
strcat(string,"! Welcome to ");
strcat(string,servername);
strcat(string,"!");
has the similar efficiency as:
pawn Код:
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"Hello,%s! Welcome to %s!",playername,servername);