Extract from string to string
#1

Hi guys, how can i extract this string: "veh 522" to a another string and when loop find a (spacebar) to break so i can get in another string like "veh"
Reply
#2

It sounds like what you are doing could be done with integers, what are you trying to do?
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
It sounds like what you are doing could be done with integers, what are you trying to do?
Here is my code:
Код:
new komch[126];
    for(new b = 1; b < 50; b++) {
        printf("Number: %d",b);
    	if(strcmp(cmdtext, " ", true, b)) {
    	    print("debugradi");
    		strmid(komch, cmdtext, 0, b);
		}
    }
im doing this for mysql system for commands permission so i cant check for commad if he type /veh 522 so i ned to extract just /veh
Reply
#4

Use sscanf.
Reply
#5

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
Use sscanf.
TNX BRO, REP+
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)