#Strings manipulation
9 messages · Page 1 of 1 (latest)
This is intended behavior and it has always worked like this. If you need to print one character use %c.
Print is just an example, actually I need to navigate every single character of string.
Is there a way to do this?
e.g.
new string = “HELLO”;
if(string[2] == ‘L’) SendClientMessage(playerid, -1, “it’s L”);
Yes, using that loop from your first post. But trying to print one character requires the use of %c, because otherwise characters will be printed until a NUL character (aka the end of the string) is encountered
Could you give me an example code following my needings please?
printf("%c", string[i]);
Ok so
new c[1], string[] = “HELLO”;
format(c, sizeof(c), “%c”, string[2]);
c will be “L”??
Yes, using that loop from your first post. - as Vince said, you don't need that new c[1] just use string[index]
So if you want the first char use printf("%c", string[0]);
what is %c?