Raised This Month: $51 Target: $400
 12% 

How to explode every character


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 03-05-2015 , 03:31   How to explode every character
Reply With Quote #1

PHP Code:
new String:text[] = "abcd";

text[0][] = "a";
text[1][] = "b";
text[2][] = "c";
text[3][] = "d";

PrintToChatAll("%s %s %s %s"text[0], text[1], text[2], text[3]); 

Last edited by lingzhidiyu; 03-05-2015 at 03:32.
lingzhidiyu is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 03-05-2015 , 05:01   Re: How to explode every character
Reply With Quote #2

PHP Code:
new String:text[] = "abcd";

// same as above
// new String:test[5];
// text[0] = 'a';
// text[1] = 'b';
// text[2] = 'c';
// text[3] = 'd';
// text[4] = '\0';

// or
// new String:test[5];
// strcopy(test, sizeof(test), "abcd");

PrintToChatAll("%c %c %c %c"text[0], text[1], text[2], text[3]); // %s = string, %c = character 
KissLick is offline
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 03-05-2015 , 05:52   Re: How to explode every character
Reply With Quote #3

Thanks!!!I only know %s %d %i %f.

Last edited by lingzhidiyu; 03-05-2015 at 05:53.
lingzhidiyu is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 03-05-2015 , 07:04   Re: How to explode every character
Reply With Quote #4

Have a look at Format Class Functions and Strings ;-)

P.S.: %N - you will like a lot :-D

Last edited by KissLick; 03-05-2015 at 07:05.
KissLick is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode