Author Topic: joining strings  (Read 2846 times)

0 Members and 1 Guest are viewing this topic.

Offline ramandu

  • Street Thug
  • *
  • Posts: 16
    • View Profile
joining strings
« on: March 01, 2010, 08:26:23 pm »
how do we join strings with other strings, and strings with integers in pawn?

something like sprintf();

MyString[256] = "this is a test string";
MyInt = 1;

sprintf("%s %s %s %d \n", "this joins", MyString, "with", MyInt);

thankyou very much.

Offline Ettans

  • VC:MP Beta Tester
  • Wiseguy
  • *
  • Posts: 56
    • View Profile
Re: joining strings
« Reply #1 on: March 01, 2010, 08:48:51 pm »
Code: [Select]
MyString[256] = "this is a test string";
MyInt = 1;

printf("this joins %s with %d\n",MyString,MyInt);

Output: this joins this is a teststring with 1

Offline Boss

  • VC:MP Beta Tester (inactive)
  • Made Man
  • *
  • Posts: 229
  • Boss
    • View Profile
    • TDH Clan Site