Detect Last Letter of Player's Name/or any string
#1

Basically, how do I reach and store last letter of a string?

For example, your name is John_Smith, how do I make the script detect "H" at the very end and store it?


I found and tried

new len = strlen(string);
printf("%c", string[len - 1]);

but it didn't seem to work.
Reply
#2

pawn Код:
new string[32] = { "This is string" };
printf("%s is last character of %s", string[strlen(string) - 1], string);
Reply
#3

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)