06.05.2015, 14:20
Off-topic, but why on earth would you want to do that..? So if they're at 'Come a Lot' it's going to say 'I'm at Come'. What possible justification is there for wanting that..?
Also, to do this is quite simple:
Also, to do this is quite simple:
pawn Код:
new originalString[] = "Hello World";
new finalString[32];
new pos = strfind(originalString, " ");
if(pos)
{
strmid(finalString, originalString, 0, pos);
}
else
{
strcat(finalString, originalString);
}
printf("Original String: '%s'\nFinal String: '%s'", originalString, finalString);
// Output:
// Original String: 'Hello World'
// Final String: 'Hello'